diff options
Diffstat (limited to 'docs/content/doc/advanced/customizing-gitea.en-us.md')
-rw-r--r-- | docs/content/doc/advanced/customizing-gitea.en-us.md | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 50ef1293a6..f42ade7799 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -18,7 +18,8 @@ menu: Customizing Gitea is typically done using the `CustomPath` folder - by default this is the `custom` folder from the running directory, but may be different if your build has set this differently. This is the central place to override configuration settings, -templates, etc. You can check the `CustomPath` using `gitea help`. You can override +templates, etc. You can check the `CustomPath` using `gitea help`. You can also find +the path on the _Configuration_ tab in the _Site Administration_ page. You can override the `CustomPath` by setting either the `GITEA_CUSTOM` environment variable or by using the `--custom-path` option on the `gitea` binary. (The option will override the environment variable.) @@ -139,6 +140,39 @@ you would need to remove `{{if .RequireHighlightJS}}` and `{{end}}`. Mermaid will detect and use tags with `class="language-mermaid"`. +#### Example: PlantUML + +You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server. +The data is encoded and sent to the PlantUML server which generates the picture. There is an online +demo server at http://www.plantuml.com/plantuml, but if you (or your users) have sensitive data you +can set up your own [PlantUML server](https://plantuml.com/server) instead. To set up PlantUML rendering, +copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highlight and put them in your +`custom/public` folder. Then add the following to `custom/footer.tmpl`: + +```html +{{if .RequireHighlightJS}} +<script src="https://your-server.com/deflate.js"></script> +<script src="https://your-server.com/encode.js"></script> +<script src="https://your-server.com/plantuml_codeblock_parse.js"></script> +<script> +<!-- Replace call with address to your plantuml server--> +parsePlantumlCodeBlocks("http://www.plantuml..com/plantuml") +</script> +{{end}} +``` + +You can then add blocks like the following to your markdown: + + ```plantuml + Alice -> Bob: Authentication Request + Bob --> Alice: Authentication Response + + Alice -> Bob: Another authentication Request + Alice <-- Bob: Another authentication Response + ``` + +The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`. + ## Customizing Gitea mails The `custom/templates/mail` folder allows changing the body of every mail of Gitea. |