Skip to main content

Continuous Integration

Travis Build Status

Release

PyPI Status

License

MIT License

A Material Design theme for Sphinx documentation. Based on Material for MkDocs, and Guzzle Sphinx Theme.

See the theme’s demonstration site for examples of rendered rst.

Installation

Install via pip:

$ pip install sphinx-material

or if you have the code checked out locally:

$ python setup.py install

Configuration

Add the following to your conf.py:

html_theme = 'sphinx_material'

There are a lot more ways to customize this theme, as this more comprehensive example shows:

# Required theme setup
html_theme = 'sphinx_material'

# Set link name generated in the top bar.
html_title = 'Project Title'

# Material theme options (see theme.conf for more information)
html_theme_options = {

    # Set the name of the project to appear in the navigation.
    'nav_title': 'Project Name',

    # Set you GA account ID to enable tracking
    'google_analytics_account': 'UA-XXXXX',

    # Specify a base_url used to generate sitemap.xml. If not
    # specified, then no sitemap will be built.
    'base_url': 'https://project.github.io/project',

    # Set the color and the accent color
    'color_primary': 'blue',
    'color_accent': 'light-blue',

    # Set the repo location to get a badge with stats
    'repo_url': 'https://github.com/project/project/',
    'repo_name': 'Project',

    # Visible levels of the global TOC; -1 means unlimited
    'globaltoc_depth': 3,
    # If False, expand all TOC entries
    'globaltoc_collapse': False,
    # If True, show hidden TOC entries
    'globaltoc_includehidden': False,
}

Customizing the layout

You can customize the theme by overriding Jinja template blocks. For example, ‘layout.html’ contains several blocks that can be overridden or extended.

Place a ‘layout.html’ file in your project’s ‘/_templates’ directory.

mkdir source/_templates
touch source/_templates/layout.html

Then, configure your ‘conf.py’:

templates_path = ['_templates']

Finally, edit your override file ‘source/_templates/layout.html’:

{# Import the theme's layout. #}
{% extends '!layout.html' %}

{%- block extrahead %}
{# Add custom things to the head HTML tag #}
{# Call the parent block #}
{{ super() }}
{%- endblock %}

Metadata

Release files for sphinx-material 0.0.36

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-material 0.0.36
File Size Uploaded
sphinx_material-0.0.36.tar.gz 783.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-material 0.0.36
File Interpreter ABI Platform
sphinx_material-0.0.36-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / sphinx_material-0.0.36.tar.gz

Download URL sphinx_material-0.0.36.tar.gz
Size 783.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eeff5f7d3dc016af32bafdf70c66e671d15c8754dbe0613dfbd629fbed912869
BLAKE2b-256 checksum
How to use checksums
53e95473d3bfc7516d97eb73bb0bce51c964b2aa4d29f84509c097229343275c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / sphinx_material-0.0.36-py3-none-any.whl

Download URL sphinx_material-0.0.36-py3-none-any.whl
Size 790.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d7f972cca7ebdfe135e28f18401673306d7c0d036d42c6e3d98b77394e61a60
BLAKE2b-256 checksum
How to use checksums
0aaa8173e966607bc9db8c40fd18382e8b0d4f19be002bc1449c160c0e93814c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.36 This release

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page