πŸ”¨ DevelopmentΒΆ

Project structureΒΆ

confirm/sphinx/
β”œβ”€β”€ __init__.py              # Extension: enables the theme, extensions and defaults
β”œβ”€β”€ config.py                # Default settings, based on the CI variables
β”œβ”€β”€ defaults.py              # Removed module, raises an upgrade hint
└── theme/
    β”œβ”€β”€ __init__.py          # Registers the theme with Sphinx (entry point)
    β”œβ”€β”€ theme.toml           # Theme definition (inherits from Furo)
    β”œβ”€β”€ macros.html          # Template helpers
    β”œβ”€β”€ base.html            # Furo override: logo prefetch links
    β”œβ”€β”€ sidebar/
    β”‚   └── brand.html       # Furo override: sidebar logos
    └── static/css/
        β”œβ”€β”€ theme.css        # Layout, typography and component overrides
        β”œβ”€β”€ vars.css         # Colour and font variables (light mode)
        └── vars-dark.css    # Colour variables (dark mode)

Set up your environmentΒΆ

Create a virtual environment and install the package in editable mode:

make venv
source .venv/bin/activate
make develop

Preview your changesΒΆ

These docs use the theme itself, so they’re the quickest way to check your changes:

make docs

The output is in build/docs. For a live preview, run:

make autodocs

It opens the docs on http://localhost:8888, and rebuilds them whenever you change the docs or the source code.

Change the stylesΒΆ

  • Change colours in vars.css and vars-dark.css. Keep both files in sync, and use the confirm IT palette variables (--cd-*) instead of hard-coded colours.

  • Change layout, typography and components in theme.css.

  • Stick to the Colours, Typography and Layout & grid guidelines in the handbook.

  • Check your changes on the 🌈 Showcase in light and dark mode.

Change the defaultsΒΆ

Parts of πŸŽ›οΈ Defaults are included straight from confirm/sphinx/config.py. The included code blocks are wrapped in marker comments:

# [docs:extensions]
EXTENSIONS = (
    ...
)
# [/docs:extensions]
  • Keep the markers when you change the code, otherwise the code block disappears from the docs and Sphinx warns β€œpattern not found”.

  • Keep the inline comments up to date, they’re the documentation of each line.

Run the testsΒΆ

make test

This validates the commit messages and runs isort, pycodestyle and pylint with our shared linter configs.

ReleaseΒΆ

The version comes from the Git tag (setuptools_scm). The GitLab pipeline builds and publishes the package and the docs, based on our shared python-library CI template.

Important

The minimal Sphinx version is defined twice: in pyproject.toml and in confirm/sphinx/theme/__init__.py. Update both when you raise it.