HTML Python JavaScript Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Sphinx Bootstrap Theme

This repository integrates the Twitter Bootstrap CSS / JavaScript framework as a Sphinx theme. A live demo is available to preview the theme.


To install the theme, download the theme directory and update your configuration

  1. Create a "_themes" directory in your project source root.

  2. Get the "bootstrap" themes either as raw files or as a zipfile from the repository.

    1. Most current way is to just clone this repo or download the full repo source and move the "bootstrap" directory to "_themes".

    2. Alternatively, there are some prepackaged theme zip files (containing only the theme files), which can be read directly by Sphinx. See the repo downloads page for available packages. Then download "":

      $ cd /path/to/_themes
      $ wget

      In addition to the "current" release, the GitHub zipfiles have either git hash releases (for development builds) or tags for official tagged releases. E.g.:
  3. Edit your configuration file to point to the bootstrap theme:

    # Activate the theme.
    html_theme_path = ['_themes']
    html_theme = 'bootstrap'
    # (Optional) Use a shorter name to conserve nav. bar space.
    html_short_title = "Demo"
    # (Optional) Logo. Should be exactly 32x32 px to fit the nav. bar.
    # Path should be relative to the html_static_path setting (e.g.,
    # "_static") in source.
    html_logo = "my_logo.png"

Theme Notes


The theme places the global TOC, local TOC, navigation (prev, next) and source links all in the top Bootstrap navigation bar, along with the Sphinx search bar on the left side.

The global (site-wide) table of contents is the "Site" navigation dropdown, which is a multi-level deep rendering of the toctree for the entire site. The local (page-level) table of contents is the "Page" navigation dropdown, which is a multi-level rendering of the current page's toc.

Generally speaking, this is a quick and dirty hack to get the basic theme going, so there are likely some oversights and lurking issues. Help and bug filings for the project are most welcome.


The theme uses the following files from Twitter Bootstrap v1.4.0:


You can drop different versions in your Sphinx "_static" directory to override these files.


Sphinx Bootstrap Theme is licensed under the MIT license.

Twitter Bootstrap is licensed under the Apache license.