Building the manual with Sphinx
This page explains how to build a local copy of the Godot manual using the Sphinx docs engine. This allows you to have local HTML files and build the documentation as a PDF, EPUB, or LaTeX file, for example. To get started, you need to:
- godot-docs repository.
- Sphinx
- readthedocs.org theme.
- godot-docs repository
requirements.txtfile. pip, Python’s package manager to install all these tools. It comes pre-installed with Python. Ensure that you install and use Python 3. Here are the commands to clone the repository and then install all requirements. Notepython3 -m pip(Unix) orpy -m pip(Windows) instead ofpip3. If both approaches fail, check that you have pip3 installed.
With the programs installed, you can build the HTML documentation from the root folder of this repository with the following command:git clone https://github.com/godotengine/godot-docs.gitpip3 install -r requirements.txt
If you run into errors, you may try the following command:# On Linux and macOSmake html# On Windows, you need to execute the ``make.bat`` file instead.make.bat html
Building the documentation requires at least 8 GB of RAM to run without disk swapping, which slows it down. If you have at least 16 GB of RAM, you can speed up compilation by running:make SPHINXBUILD=~/.local/bin/sphinx-build html
# On Linux/macOSmake html SPHINXOPTS=-j2# On Windowsset SPHINXOPTS=-j2 && make html
classes/folder contains hundreds of files._build/html/index.htmlin your web browser.MemoryErrororEOFError, you can remove theclasses/folder and runmakeagain. This will drop the class references from the final HTML documentation but will keep the rest intact. Noteclasses/folder, do not usegit add .when working on a pull request or the wholeclasses/folder will be removed when you commit. See #3157 for more detail. Alternatively, you can build the documentation by running the sphinx-build program manually:
You can also specify a list of files to build, which can greatly speed up compilation:sphinx-build -b html ./ _build
sphinx-build -b html ./ _build classes/class_node.rst classes/class_resource.rst
Building with Sphinx and virtualenv
If you want your Sphinx installation scoped to the project, you can install sphinx-build using virtualenv. To do so, run this command from this repository’s root folder:virtualenv --system-site-packages env/. env/bin/activatepip3 install -r requirements.txt
make htmlas shown above.
