Skip to main content

Matplotlib theme for Sphinx

Project description

This is the official Sphinx theme for Matplotlib documentation. It extends the pydata-sphinx-theme project, but adds custom styling and a navigation bar.

A demo of the theme built with the main branch can be seen at https://matplotlib.org/mpl-sphinx-theme/.

When creating a Matplotlib subproject you can include this theme by changing this line in your conf.py file

html_theme = 'mpl_sphinx_theme'

And by including mpl_sphinx_theme as a requirement in your documentation installation.

See the docs/conf.py file for other settings.

There are two main templates that replace the defaults in pydata-sphinx-theme:

navbar_center = mpl_nav_bar.html
navbar_end = mpl_icon_links.html

Note that the logo options need not be specified as they are included in theme initialization. The logo is stored at mpl_sphinx_theme/static/logo_{light,dark}.svg.

To change the top navbar, edit mpl_sphinx_theme/mpl_nav_bar.html

To change the social icons, edit mpl_sphinx_theme/mpl_icon_links.html

To change the style, edit mpl_sphinx_theme/static/css/style.css

Building

To build the theme with a sample page, navigate into the doc/ directory and run

make html

The built html pages can be found in doc/_build/html/

Releasing

This project uses GitHub Actions to automatically push a new release to PyPI whenever a release is made.

For example, to release a new 3.9.0 version of mpl-sphinx-theme:

  • be sure to edit mpl_sphinx_theme/_version.py

  • checkout the commit you would like to release

  • add a git tag

  • push the tag to the matplotlib/mpl-sphinx-theme repository

$ git checkout <commit-hash>
$ git tag -s -a v3.9.0 -m 'REL: 3.9.0'
$ git push upstream --tags

Finally, turn the tag into a GitHub release.

Update the required mpl-sphinx-theme version in the following files:

  • matplotlib/matplotlib: requirements/doc/doc-requirements.txt

  • matplotlib/mpl-brochure-site: requirements.txt

  • matplotlib/mpl-third-party: docs/requirements.txt

  • matplotlib/governance: requirements-doc.txt

  • matplotlib/mpl-gui: requirements-doc.txt

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

mpl_sphinx_theme-3.8.0.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

mpl_sphinx_theme-3.8.0-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file mpl_sphinx_theme-3.8.0.tar.gz.

File metadata

  • Download URL: mpl_sphinx_theme-3.8.0.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for mpl_sphinx_theme-3.8.0.tar.gz
Algorithm Hash digest
SHA256 a78c49ca43f7cb0f57cace6ca62bf3af23968ad4cf7beebe2b1721dea5d36285
MD5 1966b736a853d18a38ce7c03993a3c9d
BLAKE2b-256 cf993e7bf93b59d137df627c9fc9110a7616e59bfd7b55bd26c029139c4cd090

See more details on using hashes here.

Provenance

File details

Details for the file mpl_sphinx_theme-3.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mpl_sphinx_theme-3.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a12cc8e8712e1b288e6fb060d261152044f3a13312c0f9b401be19660fddd8f9
MD5 36fd0bc620b839efcd6eaf04fba26d47
BLAKE2b-256 a05a1e9265ef3a467c945dcd8447067d1ef572b88b3190c5e928fe0bcf0eeb9b

See more details on using hashes here.

Provenance

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