URL
https://github.com/bashtage/sphinx-material
Material Sphinx Theme
Continuous Integration
Release
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-materialor if you have the code checked out locally:
$ python setup.py installConfiguration
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:
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.htmlThen, 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 %}