Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A thin sphinx theme to customize pydata-sphinx-theme consistently cross Matplotlib projects.

License

NotificationsYou must be signed in to change notification settings

matplotlib/mpl-sphinx-theme

Repository files navigation

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

A demo of the theme built with themain branch can be seen athttps://matplotlib.org/mpl-sphinx-theme/.

When creating a Matplotlib subproject you can include this theme by changing thisline in yourconf.py file

html_theme='mpl_sphinx_theme'

And by includingmpl_sphinx_theme as a requirement in your documentationinstallation.

See thedocs/conf.py file for other settings.

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

navbar_center = mpl_nav_bar.htmlnavbar_end = mpl_icon_links.html

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

To change the top navbar, editmpl_sphinx_theme/mpl_nav_bar.html

To change the social icons, editmpl_sphinx_theme/mpl_icon_links.html

To change the style, editmpl_sphinx_theme/static/css/style.css

Overriding hard coded elements

This theme is primarily designed to be used with subprojects that are part of the mainMatplotlib webiste (e.g.,our cheatseetsandlist of third-party packages).As such several elements are hard coded. However, the theme may also be used byother subprojects that need to change the hard-coded defaults.The following sections explain how to reset these back to their defaults by modifyinghtml_theme_options inconf.py.

Header section links

Use a copy ofthe default pydata-sphinx-theme navbar and set the'navbar_center' key to this HTML file inhtml_theme_options.

Building

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

make html

The built html pages can be found indoc/_build/html/

Releasing

This projectuses GitHub Actionsto automatically push a new release to PyPI whenever a release is made.

For example, to release a new3.9.0 version ofmpl-sphinx-theme:

  • be sure to editmpl_sphinx_theme/_version.py
  • checkout the commit you would like to release
  • add a git tag
  • push the tag to thematplotlib/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 requiredmpl-sphinx-theme version in the following files:

About

A thin sphinx theme to customize pydata-sphinx-theme consistently cross Matplotlib projects.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors11


[8]ページ先頭

©2009-2025 Movatter.jp