0
Fork 0
mirror of https://projects.blender.org/infrastructure/gitea-custom.git synced 2024-12-22 07:13:09 -05:00
blender-projects-gitea-custom/sphinx/README.md

894 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

[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.