Files
gitea-pages/admin-guide/mgmt-tools/sphinx.rst
2023-06-14 16:35:50 +02:00

1.3 KiB

Sphinx

Sphinx is a tool for generating documentation from reStructuredText.

It can generate various formats, including HTML and PDF.

Installing Sphinx

basically it is enough to install the python-sphinx package:

On RHEL 7:

yum install python-sphinx

On RHEL8:

dnf install python3-sphinx

Editing

On Linux with the inotify-tools it is easy to have the documentation recompiled automatically while editing. Just run the following in the base directory of the documentation:

inotifywait --monitor --recursive --event close_write --exclude '_build' . | while read l; do make html;done

On OSX you can install fswatch and then run the following:

fswatch --exclude=_build --monitor=fsevents_monitor --recursive --event Updated --event Created --event Renamed .| while read l; do make html ;done

An even better alternative is sphinx-autobuild, which can be installed using pip:

pip install sphinx-autobuild

It can then be called like this:

sphinx-autobuild /path/to/sphinx/repo /path/to/sphinx/repo/_build/html/