Sphinx theme used by Guzzle.
Project Links
Meta
Author: Michael Dowling
Classifiers
Development Status
- 3 - Alpha
Intended Audience
- Developers
Natural Language
- English
License
- OSI Approved :: MIT License
Programming Language
- Python
Sphinx theme used by Guzzle: http://guzzlephp.org
Installation
Install via pip:
$ pip install guzzle_sphinx_theme
or if you have the code checked out locally:
$ python setup.py install
Configuration
Add the following to your conf.py:
import guzzle_sphinx_theme
# Adds an HTML table visitor to apply Bootstrap table classes
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
# Set the name of the project to appear in the sidebar
"project_nav_name": "Project Name",
}
There are a lot more ways to customize this theme, as this more comprehensive example shows:
import guzzle_sphinx_theme
# Adds an HTML table visitor to apply Bootstrap table classes
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
# Set the path to a special layout to include for the homepage
"index_template": "special_index.html",
# Set the name of the project to appear in the left sidebar.
"project_nav_name": "Project Name",
# Set your Disqus short name to enable comments
"disqus_comments_shortname": "my_disqus_comments_short_name",
# Set you GA account ID to enable tracking
"google_analytics_account": "my_ga_account",
# Path to a touch icon
"touch_icon": "",
# Specify a base_url used to generate sitemap.xml links. If not
# specified, then no sitemap will be built.
"base_url": ""
# Allow a separate homepage from the master_doc
"homepage": "index",
# Allow the project link to be overriden to a custom URL.
"projectlink": "http://myproject.url",
}
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 extra_head %}
{# Add custom things to the head HTML tag #}
{# Call the parent block #}
{{ super() }}
{%- endblock %}
0.7.11
Sep 09, 2015
0.7.10
Jun 29, 2015
0.7.9
Jun 25, 2015
0.7.8
Jun 10, 2015
0.7.7
May 02, 2015
0.7.6
Apr 30, 2015
0.7.5
Apr 28, 2015
0.7.4
Apr 28, 2015
0.7.3
Apr 24, 2015
0.7.2
Apr 06, 2015
0.7.1
Apr 04, 2015
0.7.0
Apr 03, 2015
0.6.0
Mar 15, 2014
0.5.0
Nov 01, 2013
0.4.0
Oct 31, 2013
0.3.1
Sep 19, 2013
0.3
Sep 19, 2013
0.2.1
May 09, 2013
0.2
May 09, 2013
0.1
May 09, 2013
Files in release
No dependencies