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.
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 three main templates that replace the defaults in pydata-sphinx-theme:
navbar_start = mpl_navbar_logo.html
navbar_center = mpl_nav_bar.html
navbar_end = mpl_icon_links.html
Note that the option html_logo need not be specified as it is included in mpl_sphinx_theme/mpl_navbar_logo.html. The logo is stored at mpl_sphinx_theme/static/images/logo2.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.
$ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for mpl_sphinx_theme-3.6.0.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c56a924b04938d16d01b8b415314c64774ff20a04a7e695e18077e25065a5fa1 |
|
MD5 | 201e793766807c42e62a589ff3c01f59 |
|
BLAKE2b-256 | 211938e9aca2f977f7a2c61a207472e180008b3bb97a66876d789c74b712b509 |