Learn how to add the theme to your Sphinx project.
html_theme configuration option to your Sphinx configuration file
You can load the theme from a directory on your computer. This can be useful if you want to build your own theme, and you don’t want to separate your documentation from the theme.
When loading the theme from a local directory, you need to manage the dependencies
yourself. This theme needs the
beautifulsoup package to run. You can install it with
pip install bs4
The following example assumes you have a Sphinx project with the following structure,
and you want to load the theme from the
./ ├── conf.py ├── index.rst ├── _themes/ └── ...
To load the theme from a local directory:
Copy the directory
_themes/directory in the Sphinx project:shell
cp -r sphinxawesome-theme/src/sphinxawesome_theme _themes/
_themes/directory to the system path in the Sphinx configuration:
Adding this directory makes it discoverable for Python.
themesdirectory to the
exclude_patternslist to prevent Sphinx from searching this path for documentation files:
Add the theme as an extension and as a theme: