Sphinx Book Theme

1.2.0 · maintenance · verified Sat Apr 11

Sphinx Book Theme is a lightweight Sphinx theme designed to mimic the look-and-feel of an interactive book, utilizing Bootstrap 5 for visual elements and functionality. It provides visual classes tailored for Jupyter Notebooks, supporting cell inputs, outputs, and interactive features. The current version is 1.2.0, released in March 2026. However, the project is officially in maintenance mode, accepting bug fixes but with limited new feature development due to a lack of dedicated resources.

Warnings

Install

Imports

Quickstart

To quickly set up documentation with Sphinx Book Theme, first initialize a Sphinx project using `sphinx-quickstart`. Then, install the theme via pip. The core step involves modifying your `conf.py` file to set `html_theme = "sphinx_book_theme"` and optionally configure `html_theme_options` for features like a repository link. Finally, build your documentation using `make html` or `sphinx-build`.

# 1. Create a new Sphinx project (if you don't have one)
sphinx-quickstart

# 2. Install the theme
pip install sphinx-book-theme

# 3. Edit conf.py in your Sphinx project's source directory
#    Add 'sphinx_book_theme' to the html_theme variable:
#    html_theme = "sphinx_book_theme"
#    Optionally, add theme options, e.g., for a GitHub button:
#    html_theme_options = {
#        "repository_url": "https://github.com/executablebooks/sphinx-book-theme",
#        "use_repository_button": True,
#        "path_to_docs": "docs", # relative path to docs root from repo root
#        "home_page_in_toc": True,
#    }

# 4. Create an index.rst (or .md if using MyST-parser) and other content files
#    Example index.rst:
#    ====================
#    Welcome to My Book!
#    ====================
#
#    .. toctree::
#       :hidden:
#       :maxdepth: 2
#       :caption: Contents
#
#       page1
#       page2

# 5. Build your documentation
make html # or sphinx-build -M html . _build

view raw JSON →