Skip to content

git-pull/gp-sphinx

Repository files navigation

gp-sphinx · Python Package License

An integrated autodoc design system for Sphinx that replaces ~300 lines of duplicated docs/conf.py with ~10 lines and produces beautiful, consistent API documentation.

Requirements

  • Python 3.10+
  • Sphinx 8.1+

Install

$ pip install gp-sphinx
$ uv add gp-sphinx

Usage

Replace your docs/conf.py with:

"""Sphinx configuration for my-project."""
from __future__ import annotations

from gp_sphinx.config import merge_sphinx_config

import my_project

conf = merge_sphinx_config(
    project="my-project",
    version=my_project.__version__,
    copyright="2026, Tony Narlock",
    source_repository="https://github.com/git-pull/my-project/",
    intersphinx_mapping={
        "py": ("https://docs.python.org/", None),
    },
)
globals().update(conf)

The autodoc design system

Out of the box, merge_sphinx_config() activates:

  • Componentized layouts (sphinx-ux-autodoc-layout) — card containers, parameter folding, managed signatures
  • Clean type hints (sphinx-autodoc-typehints-gp) — simplified annotations with cross-referenced links, replacing sphinx-autodoc-typehints and sphinx.ext.napoleon
  • Unified badge system (sphinx-ux-badges) — type and modifier badges with a shared colour palette
  • Autodoc extensions — Python API, argparse CLIs, pytest fixtures, FastMCP tools, docutils directives, Sphinx config values
  • IBM Plex fonts via Fontsource with preloaded web fonts
  • Full dark mode theming via CSS custom properties

See the Gallery for live demos of every component.

Workspace architecture

Lower layers never depend on higher ones:

  • Common librariessphinx-ux-badges, sphinx-ux-autodoc-layout, sphinx-autodoc-typehints-gp, sphinx-fonts
  • Autodoc extensionssphinx-autodoc-api-style, sphinx-autodoc-argparse, sphinx-autodoc-docutils, sphinx-autodoc-fastmcp, sphinx-autodoc-pytest-fixtures, sphinx-autodoc-sphinx
  • Build utilssphinx-vite-builder (PEP 517 backend + hatchling build hook + Sphinx extension that runs Vite via pnpm; publishable to PyPI for use outside this workspace)
  • Theme and coordinatorgp-sphinx, sphinx-gp-theme, gp-furo-theme
  • SEOsphinx-gp-opengraph, sphinx-gp-sitemap (auto-loaded by gp-sphinx when docs_url is set)

See the Architecture and Packages pages for the full package map; the docs site auto-enumerates as the workspace grows.

More information

About

Sphinx shared components for git-pull projects

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors