• Stars
    star
    169
  • Rank 224,453 (Top 5 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sphinx theme used by Guzzle

Guzzle Sphinx Theme

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

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

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",

    # 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 %}

Note

If you are using Readthedocs, then you might run into an issue where they don't currently allow you to extend layout.html.

More Repositories

1

guzzle

Guzzle, an extensible PHP HTTP client
PHP
23,172
star
2

promises

Promises/A+ library for PHP with synchronous support
PHP
7,584
star
3

RingPHP

[DEPRECATED] Simple handler system used to power clients and servers in PHP (this project is no longer used in Guzzle 6+)
PHP
843
star
4

streams

[DEPRECATED] Provides a simple abstraction over streams of data
PHP
637
star
5

guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
PHP
251
star
6

oauth-subscriber

Signs Guzzle requests using OAuth 1.0 (Guzzle 6+)
PHP
241
star
7

guzzle3

[DEPRECATED] This is end of life and not maintained. Migrate to https://github.com/guzzle/guzzle
PHP
150
star
8

uri-template

PHP
138
star
9

command

Provides the foundation for building web service clients with Guzzle
PHP
110
star
10

cache-subscriber

[DEPRECATED] Private transparent proxy cache that caches HTTP responses (Guzzle 5+)
PHP
63
star
11

retry-subscriber

[DEPRECATED] Retries failed requests using customizable retry strategies. Guzzle 4/5 only.
PHP
61
star
12

log-subscriber

[DEPRECATED] Logs HTTP requests and Responses as they are sent over the wire. Not used in Guzzle 6.
PHP
43
star
13

progress-subscriber

[DEPRECATED] Emits upload and download progress events (Guzzle 4)
PHP
19
star
14

message-integrity-subscriber

[DEPRECATED] Verifies the integrity of HTTP responses using customizable validators. Guzzle 4/5.
PHP
12
star
15

test-server

A node.js server and a PHP controller class one can use when testing
JavaScript
8
star
16

.github

Default community health files
3
star