mirror of
https://projects.blender.org/infrastructure/gitea-custom.git
synced 2024-12-22 15:23:32 -05:00
1,010 B
1,010 B
Sphinx RST to HTML Preview
Command for generating previews of RST files on projects.blender.org.
The template is adapted from the Blender manual to support the same extensions.
Deployment
Install dependencies.
pip3 install -r requirements.txt
Add to Gitea app.ini.
[markup.restructuredtext]
ENABLED = true
FILE_EXTENSIONS = .rst
RENDER_COMMAND = "timeout 30s ./custom/sphinx/sphinx_to_html.py --user sphinx --user-work-dir /path/to/dir"
IS_INPUT_FILE = true
[markup.sanitizer.restructuredtext]
ELEMENT = div
ALLOW_ATTR = class
REGEXP = ^(restructuredtext)$
[repository.editor]
LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd,.rst
PREVIEWABLE_FILE_MODES = markdown,restructuredtext
The sphinx
user is required for sandboxing of sphinx-build which we do not
assume to be secure. The work directory should be writable by both the gitea
user and sphinx user, with the sphinx user having as little access as possible
to other directories.