A short tutorial on how to build documentation in Sphinx
Published on July 13, 2023 by Dishie Vinchhi
documentation sphinx autosummary
cd docs
sphinx-quickstart
Enter ‘y’ for all the following questions.
conf.py
file, uncomment lines #13, #14, #15extensions
list which would initially be empty. extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'sphinx.ext.autosummary',
'sphinx.ext.linkcode',
"sphinx.ext.extlinks",
'sphinx_gallery.gen_gallery',
'sphinxcontrib.bibtex',
'sphinx_panels',
'numpydoc',
'sphinx_copybutton'
]
html_theme
to any of your choice from the Sphinx themes. html_theme = 'pydata_sphinx_theme'
.index.rst
, add the ‘modules’ to the toctree in the given manner... toctree::
:maxdepth: 2
:caption: Contents:
modules
cd .. (to go out of docs)
sphinx-apidoc -o docs/ <your current directory name>
A list of .rst files will be generated inside docs.
make html
cd docs
make html
index.html
locally to see your documentation on localhost.