Sphinx Basic NG

1.0.0b2 · active · verified Fri Apr 10

Sphinx Basic NG (sphinx-basic-ng) is a modernised skeleton for Sphinx themes, providing a foundational three-column layout and shared implementations of common components. It aims to simplify Sphinx theme development by offering a consistent vocabulary and a robust base to build upon, serving as an advanced alternative to Sphinx's built-in basic theme. The current version is 1.0.0b2. As a foundational toolkit, its release cadence is likely tied to major Sphinx updates and the evolution of documentation design patterns.

Warnings

Install

Imports

Quickstart

After initializing a Sphinx project with `sphinx-quickstart`, modify your `conf.py` file to set `html_theme = 'sphinx_basic_ng'`. You can further customize the theme via `html_theme_options`.

import os
import sys

# Basic Sphinx project setup (run sphinx-quickstart first)
project = 'My Awesome Project'
copyright = '2024, Your Name'
author = 'Your Name'
release = '0.1.0'

# -- General configuration ---------------------------------------------------
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx.ext.viewcode',
    'sphinx.ext.todo',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_basic_ng'
html_static_path = ['_static']

# Example of theme options (customize as needed)
html_theme_options = {
    'sidebar_hide_logo': False,
    'light_css_variables': {
        'color-brand-primary': '#6200EE',
        'color-brand-content': '#00B0FF',
    },
    'dark_css_variables': {
        'color-brand-primary': '#BB86FC',
        'color-brand-content': '#00B0FF',
    }
}

view raw JSON →