Skip to main content

The Nefertiti for Sphinx theme.

Project description

Nefertiti for Sphinx

Nefertiti is a theme for Sphinx that features:

  • Responsive design, based on Bootstrap 5.3.
  • Text input field to filter the index.
  • Font configuration compliant with EU's GDPR.
  • Different fonts can be used for different elements.
  • Light and dark color schemes, for normal text and code highlighted with Pygments styles.
  • Diverse color sets are available: blue, indigo, purple, pink, red, orange, yellow, ...
  • Optional highlighting of the project repository in the header.
  • Optional project version selector in the header.
  • Customizable footer links.

See it in action in sphinx-themes.org.

Index filtering

By default the index shows the content folded. Opening or closing items is remembered while browsing the documentation. To quickly find items use the input filter. The filter will display items that could be invisible within a folded item. When the user types in the input field, let us say fo, the index gets filtered with all the entries that match those two characters. So the index will display three matches: Fonts, Footer links and Footnotes. Those three entries were all folded within their sections:

The TOC on the right side

The Table of Contents, displayed on the right side, spans itself to the right border of the browser to display long items, improving readability.

Other features

Nefertiti for Sphinx comes with the following color sets. Change between them using the attribute display of the html_theme_options setting.

In order to be compliant with EU's GDPR, Nefertiti for Sphinx comes bundled with a group of fonts licensed for free distribution. Adding more fonts is explained in the User's Guide:

  • Assistant
  • Exo
  • Montserrat
  • Mulish
  • Nunito
  • Open Sans
  • Red Hat Display
  • Sofia Sans
  • Ubuntu
  • Varta
  • Work Sans
  • Fira Code (monospace)
  • Red Hat Mono (monospace)
  • Ubuntu Mono (monospace)

Combine up to 5 different fonts:

html_theme_options = {
    "sans_serif_font": "Nunito",
    "documentation_font": "Open Sans",
    "monospace_font": "Ubuntu Mono",
    "project_name_font": "Nunito",
    "doc_headers_font": "Georgia",

    "documentation_font_size": "1.2rem",
    "monospace_font_size": "1.1rem",
}

To use it

Install the package from PyPI:

pip install sphinx-nefertiti

Edit the conf.py file of your Sphinx project and change the html_theme setting:

html_theme = "sphinx_nefertiti"

Now rebuild the docs and serve them to get a first glimpse of your site made up with Nefertiti for Sphinx. It has many customizable options worth to explore. You might want to continue reading the customization section of the docs.

To develop it

Clone the Git repository, create a Python virtual environment, and install the NodeJS packages:

git clone git@github.com:danirus/sphinx-nefertiti.git
cd sphinx-nefertiti
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
nvm use --lts
npm install

Before contributing, please, install the pre-commit hook scripts:

pre-commit install

There are a comprehensive number of scripts in the package.json. Beyond them there is a Makefile that saves time when building the CSS and JavaScript bundles to deliver them within the Python package of the theme.

Further read the following sections:

License

Project distributed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_nefertiti-0.4.2.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

sphinx_nefertiti-0.4.2-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file sphinx_nefertiti-0.4.2.tar.gz.

File metadata

  • Download URL: sphinx_nefertiti-0.4.2.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for sphinx_nefertiti-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7aa212d5366ae7e3914460b1ef4564dcca6c973e374a8985ab895ae6042e3d1e
MD5 bc4f3d53053de73b76b9b06ee0b637ad
BLAKE2b-256 c75f93c8277e0f5143dee0c1c610c188d26751836291fb5fc87c84aa78e4df07

See more details on using hashes here.

File details

Details for the file sphinx_nefertiti-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_nefertiti-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0ae070d69c316ec4deb758876c0596b4b2a3c976743502bff88f5be70c85b03
MD5 da825445026137aaf32d4eb2ff1d6bea
BLAKE2b-256 084db3af9874cb5b15f3e0cb1f83e2043f2e25d46bfff49afe7ae8aeacc398f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page