Skip to content

Instantly share code, notes, and snippets.

@dgarcia360
Last active November 3, 2021 08:53
Show Gist options
  • Save dgarcia360/25d6826ec294bb79fdcb8ca47c91d17a to your computer and use it in GitHub Desktop.
Save dgarcia360/25d6826ec294bb79fdcb8ca47c91d17a to your computer and use it in GitHub Desktop.
Installing Sphinx on Windows

Requirements

Instructions

Run the following commands in the folder you want to create a documentation project.

  1. Install Sphinx
pip install sphinx
  1. 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.
  1. 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.

Next Steps

See Getting Started with Sphinx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment