- To have Python 3.7+ installed.
Run the following commands in the folder you want to create a documentation project.
- Install Sphinx
pip install sphinx
- Run
sphinx-quickstart
.
sphinx-quickstart
We will be presented with a series of questions, the answer to which can depend from project to project, but a generally safe answer set is presented below:
Welcome to the Sphinx 4.1.2 quickstart utility.
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
Selected root path: .
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/n) [n]: n
The project name will occur in several places in the built documentation.
> Project name: Project name
> Author name(s): Your Name
> Project release []:
If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.
For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.
> Project language [en]:
Creating file C:\Users\dgarc\docs_pentera\conf.py.
Creating file C:\Users\dgarc\docs_pentera\index.rst.
Creating file C:\Users\dgarc\docs_pentera\Makefile.
Creating file C:\Users\dgarc\docs_pentera\make.bat.
Finished: An initial directory structure has been created.
- Run the following command to build the docs:
sphinx-build -b html . _build
If everything goes well, you will see the file index.html
under _build
. Open it with your favorite browser to preview the documentation site.