Add renderer for Sphinx .rst files, for user manual previews
Ref infrastructure/blender-projects-platform#51 Pull Request: https://projects.blender.org/infrastructure/gitea-custom/pulls/2
This commit is contained in:
parent
3913b53f29
commit
c676b7b76c
7 changed files with 395 additions and 0 deletions
28
sphinx/README.md
Normal file
28
sphinx/README.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# 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.
|
Loading…
Add table
Add a link
Reference in a new issue