gitea: Add support for external renders for code blocks

Just as you can specify an external render for a specific file, it would be cool to have an external render for a specific code block. This should be handled backend and the data feed to the external script would be the content of the code block instead of a complete file.

Code highligtning is currently handled frontend by javascript. Placing the external tool support in the backend would allow more possibilities on what is possible to do as it is not requiring javascript. It could be an option whether the output shall still be in a code block.

A specific use case for this is plantuml (#3902). So with below code block everything from (including) @startuml to @enduml would be sent to the script that can generate a html code with an inline image of the uml.

```plantuml @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request Alice <-- Bob: Another authentication Response @enduml ````

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

mermaid got in and if you need some extra renderer you can inject custom JS to do so

mermaid has been supported.