Depending on how you want to use the theme and its extensions, use one of the following methods to install the Sphinx awesome theme.
On this page
You can install a released version from the Python Package Index, PyPI:
pip install sphinxawesome-theme
You can also install the latest development version of the theme directly from GitHub:
pip install git+https://github.com/kai687/sphinxawesome-theme.git
Check the “HEAD” section at the top of the CHANGELOG file. These features and bugfixes are available in the version on GitHub but not yet in the released version on PyPI.
If you want to use a modified version of the theme, you can load the theme from a local Python package. This doesn’t require any special configuration, but can be slower initially, since you need to rebuild and reinstall the local package after each modification.
Build the theme as a Python package:shell
This command creates a new directory
dist/containing the source distribution in
.tar.bz2format and as wheel in a
In your project, install the theme from the locally built package:shell
pip install /path/to/sphinxawesome_theme/dist/sphinxawesome_theme-*-py3-none-any.whl
This command installs the pre-built package in the current environment.
In both cases, create a local copy first.
In order to modify the theme, create a local copy first:
Optional: fork the repository
If you don’t want to merge your changes with the original repository, you can skip this step. See Fork a repo in the GitHub documentation for more information.
Clone the (forked) repository:
If you forked the repository, enter:
git clone https://github.com/YOUR_GITHUB_USERNAME/sphinxawesome-theme.git
YOUR_GITHUB_USERNAMEwith your GitHub username. If you didn’t fork the repository, clone the original repository:shell
git clone https://github.com/kai687/sphinxawesome-theme.git
See Cloning a repository in the GitHub documentation for more information.
Follow these steps to install the Python dependencies:
Follow the recommended steps for how to install Poetry.
On macOS and Linux, enter:shell
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
On Windows PowerShell:PowerShell
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
Install Nox via pip:shell
pip install --user --upgrade nox
If you want to use the same version of Poetry and Nox as the original repository, see the versions in the file
Install the Python dependencies:shell
Check Poetry’s documentation for more information.
Optional: install pre-commit hooks:shell
poetry run pre-commit install
If you don’t plan on committing any changes to the forked repository, you can skip this step. Check the file
.pre-commit-config.yamlto see which pre-commit hooks are active.
To test pre-commit in combination with poetry, run:shell
poetry run pre-commit run --all
Run a Nox session.
You can run any Nox session to confirm that the environment is working. To list the available sessions, enter:shell
noxwithout any option to run the default sessions, such as building the docs, testing, and linting.
For example, to build the documentation with Python 3.9, enter:shell
nox -s docs -p 3.9
Check, if Node.js is installed:shell
If Node.js is installed, this command returns the version number, for example:shell
If the command fails, you may need to install Node.js first, or activate it in your current terminal session. Have a look at the Node Version Manager project for a way to install and manage multiple versions of Node.js.
npm install --global yarn
The awesome theme uses yarn (classic). The dependencies are pinned to the specific versions in the
Change to the
./sphinxawesome-theme/ ├src/ │ ├sphinxawesome_theme/ │ └theme-src/ ├docs/ └...
Build the theme:shell