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

Manually for now… see the todo below for how we hope to eventually do it automagically.

  • be sure to edit mpl_sphinx_theme/_version.py

$ git checkout <commit-hash>
$ git tag -a x.y.z -m 'Version x.y.z'
$ git push upstream main --tags
$ python -m build -s -w
$ twine upload dist/mpl_sphinx_theme-x.y.z*

TODO: This project uses GitHub Actions to automatically push a new release to PyPI whenever a git tag is pushed. For example, to release a new x.y.z version of mpl-sphinx-theme, checkout the commit you would like to release, add a git tag, and push the tag to the main branch of the matplotlib/mpl-sphinx-theme repository:

TODO: After a new release is published on PyPI, a pull request to the mpl-sphinx-theme conda-forge feedstock for the new x.y.z release will automatically be opened by conda-forge bots.

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.7.1.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

mpl_sphinx_theme-3.7.1-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpl_sphinx_theme-3.7.1.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for mpl_sphinx_theme-3.7.1.tar.gz
Algorithm Hash digest
SHA256 0b3c6d04f2090c1f60c4dd8efb92a6a17398ff865d88336ec6e797553eb867cd
MD5 7ff35c1ee7ac6767f4aab8acd14bf93b
BLAKE2b-256 411256a91d6cd7f9617188291a731ab94fad8c18d1e7b2f70e2dc3008d6cbf03

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for mpl_sphinx_theme-3.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14c09be167c44f67c30bfa12c83e4ead9f2aa3a61a64a49b8004137e28ed798f
MD5 b71baacc75056c5678befa7853b5849a
BLAKE2b-256 453d1ad39032cba6751648d49395ac486ad6b562382fce09d2e457c46115b513

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