Use a custom template for rst2html with gitea

17 Apr 2021

The other day I noticed that on my self hosted instance of gitea reStructuredText files was not properly rendered: <html> and '' tags were popping out to the rendered text.

To solve the issue I decided to write a custom template for rst2html to get only the body part:


Then I just updated my gitea's app.ini section related to reStructuredText:

ENABLED         = true
RENDER_COMMAND  = " --template=/usr/share/docutils/writers/htmlbody/template.txt"
IS_INPUT_FILE   = false

where /usr/share/docutils/writers/htmlbody/template.txt is the absolute path of the custom template showed above.