0
Fork 0
mirror of https://projects.blender.org/infrastructure/gitea-custom.git synced 2024-12-22 15:23:32 -05:00
blender-projects-gitea-custom/sphinx
2023-05-09 16:45:59 +02:00
..
template Add renderer for Sphinx .rst files, for user manual previews 2023-04-24 13:09:18 +02:00
README.md Sphinx: simplify running process as another user 2023-05-09 16:45:59 +02:00
requirements.txt Add renderer for Sphinx .rst files, for user manual previews 2023-04-24 13:09:18 +02:00
sphinx_to_html.py Sphinx: simplify running process as another user 2023-05-09 16:45:59 +02:00

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 sudo -u sphinx python3 ./custom/sphinx/sphinx_to_html.py

[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 so secure that it should have access to all gitea data. This user needs read-only access to the custom/sphinx, and the user running gitea needs to be able to run a process as the sphinx user.