1.4 KiB
1.4 KiB
Install Sphinx
Install Sphinx from Debian repositories:
apt-get install python-sphinx
Install Sphinx using virtualenv (assumes virtualenv is already installed):
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
Build Documentation
The documentation can be generated using the following commands
cd docs/
make html
The documentation should now be available in _build/
directory under the
docs/
directory.
To generate the Spanish translations:
cd docs/
make translations
The Spanish version will be generated in docs/_build/spanish
.
New Pages and Internationalisation
Translation works using sphinx-intl
. It creates .po files where English phrases can be converted to other languages.
To add a page and create the .po file for translation:
- Set up the virtualenv as described above. Activate it and install the requirements.
- Create a new file for the page such as
admin/file.rst
. - Edit it and make it correct in English (
make html
). - Open terminal to
/docs
and runmake gettext
. This creates files under_build/locale
- Run
sphinx-intl update -p _build/locale/ -l es
to refresh the .po files - Edit .po files under
locale/es/LC_MESSAGES/...
- Run
make translations
to generate the Spanish version - Commit changes.