Extras
Contents
Extras#
Here are some cool things you can add to your docs.
Theme#
Sphinx comes with builtin themes. This documentation uses the Sphinx Book Theme.
Add the theme to the requirements and install it,
echo sphinx-book-theme >> docs/requirements.txt pip install sphinx-book-theme
Go to the
conf.pyfile and add the following lines,html_theme = 'sphinx_book_theme'
This theme allows you to add hyperlinks to the source repository and more.
Math#
Render math using the mathjax extension.
conf.py#
extensions = [
...,
'sphinx.ext.mathjax',
]
Here is an example,
\[f(x) = \int_0^\infty x^2 \, dx\]
Generate notebooks#
Use the nbsphinx extension to automatrically generate documentation
from Jupyter notebooks.
Intersphinx#
Reference external documentation in your docstrings using the
intersphinx extension.