Skip to content

A material-based, responsive theme inspired by mkdocs-material

License

Notifications You must be signed in to change notification settings

f4pga/sphinx_f4pga_theme

This branch is 30 commits ahead of, 13 commits behind bashtage/sphinx-material:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3f163c4 · Mar 17, 2024
Jul 23, 2021
Mar 17, 2024
Mar 17, 2024
Jul 23, 2021
May 12, 2022
Aug 23, 2019
Mar 17, 2024
Aug 26, 2019
Mar 17, 2024
Apr 20, 2020
Aug 23, 2019
May 12, 2022
May 12, 2022
Aug 23, 2019
Feb 4, 2020
May 8, 2020
May 12, 2022
May 12, 2022
Mar 17, 2024

Repository files navigation

Material Sphinx Theme

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_symbiflow_theme'

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

# Required theme setup
html_theme = 'sphinx_symbiflow_theme'

# 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': 'deep-purple',
    'color_accent': 'indigo',

    # Set the repo location to get a badge with stats
    'github_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 %}

About

A material-based, responsive theme inspired by mkdocs-material

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 33.0%
  • JavaScript 32.0%
  • Python 29.3%
  • HTML 5.4%
  • Shell 0.3%