Material sphinx theme
Project description
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-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'
# 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 %}
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
Built Distribution
Hashes for sphinx_material-0.0.29-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce744305bc67ca5e5c4d7d97ca48e34256c9979c7a6623a8a98b9fa92768f8d0 |
|
MD5 | dfce0820159402af0e50797aaba96c0a |
|
BLAKE2b-256 | 216d7d2fde69bb87a60bca7b5b8a95f70271421a0c9d70a82bd5633b05ca697c |