Commit 1278de6
authored
Refactor for improved autodoc typings, UX (#18)
gp-sphinx moves from a shared-config package to an integrated autodoc
design system. Twelve packages in three dependency tiers share one
badge palette, one layout pipeline, one typehint renderer, and one
CSS vocabulary — so Python APIs, argparse CLIs, pytest fixtures,
Sphinx config values, docutils directives, and FastMCP tools all
render like they belong together. Four reader-facing sidebar buckets
(Domain Packages / UX / Utils / Internal) give a separate navigation
axis on top of the dependency map.
- **Two new foundation packages** — `sphinx-ux-autodoc-layout`
introduces componentized autodoc output (card regions, parameter
folding, managed signatures); `sphinx-autodoc-typehints-gp` is a
single-package replacement for `sphinx-autodoc-typehints` +
`sphinx.ext.napoleon` that resolves annotations statically at
build time with no monkey-patching.
- **`argparse` Sphinx domain** — `sphinx-autodoc-argparse` now ships
a real `Domain` subclass. Programs, options, subcommands, and
positional arguments each have their own `ObjType` and
`:argparse:*` xref role; two auto-generated indices give an
alphabetical programs list and a program-grouped options list.
`:option:` / `std:cmdoption` continues to resolve for intersphinx
consumers. `Framework :: Sphinx :: Domain` classifier added.
- **Unified visual vocabulary** — every class, directive, and CSS
custom property is namespaced under a single `gp-sphinx-*`
two-tier BEM root (`gp-sphinx-badge`, `gp-sphinx-fastmcp__*`,
etc.). The six opaque per-package prefixes (`sab-`, `smf-`,
`spf-`, `api-`, `gas-`, `gal-`) are retired and the duplicate
palettes that hid behind them collapse to one source of truth.
- **Sphinx 8.1 floor + typed domains** — workspace-wide floor bump
unlocks `env.domains.<name>_domain` typed accessors; `t.cast` /
`# type: ignore` workarounds across the domain-access paths retire
as a result.
- **Rebuilt test harness** — a shared `SphinxScenario` cache keyed
by content-hash digest reuses identical builds across tests. Most
cases now run against the docutils doctree directly; a
syrupy-based snapshot layer locks doctree structure, rendered
HTML, and warning output with path and ANSI normalization built
in.
- **Codified workspace conventions** — `AGENTS.md` now documents the
`gp-sphinx-*` BEM namespace, the rule that any test which
constructs a `Sphinx` app (including `buildername="dummy"`) gets
`@pytest.mark.integration`, and the per-package CSS
self-containment contract.
Breaking changes:
Workspace package renames — update imports and `extensions =` lists
downstream; old names keep redirecting for docs URLs via
`docs/redirects.txt`:
| Old | New |
|----------------------------|--------------------------------|
| `sphinx-argparse-neo` | `sphinx-autodoc-argparse` |
| `sphinx-gptheme` | `sphinx-gp-theme` |
| `sphinx-autodoc-badges` | `sphinx-ux-badges` |
| `sphinx-autodoc-layout` | `sphinx-ux-autodoc-layout` |
| `sphinx-typehints-gp` | `sphinx-autodoc-typehints-gp` |
Directive renames:
| Old | New |
|---------------------------|---------------------------|
| `autosphinxconfig-index` | `autoconfigvalue-index` |
| `fastmcp-toolsummary` | `fastmcp-tool-summary` |
| `doc-pytest-plugin` | `auto-pytest-plugin` |
Runtime floor bumped to Sphinx 8.1 (was 7.x).
See also:
- Gallery: https://gp-sphinx.git-pull.com/gallery.html
- Architecture: https://gp-sphinx.git-pull.com/architecture.html
- What's new: https://gp-sphinx.git-pull.com/whats-new.html219 files changed
Lines changed: 22278 additions & 5445 deletions
File tree
- .github/workflows
- docs
- _ext
- _static/css
- packages
- project
- notes
- packages
- gp-sphinx
- src/gp_sphinx
- sphinx-autodoc-api-style
- src/sphinx_autodoc_api_style
- _static/css
- sphinx-autodoc-argparse
- src/sphinx_autodoc_argparse
- sphinx-autodoc-badges
- src/sphinx_autodoc_badges
- _static/css
- sphinx-autodoc-docutils
- src/sphinx_autodoc_docutils
- _static/css
- sphinx-autodoc-fastmcp
- src/sphinx_autodoc_fastmcp
- _static/css
- sphinx-autodoc-pytest-fixtures
- src/sphinx_autodoc_pytest_fixtures
- _static/css
- sphinx-autodoc-sphinx
- src/sphinx_autodoc_sphinx
- _static/css
- sphinx-autodoc-typehints-gp
- src/sphinx_autodoc_typehints_gp
- sphinx-fonts
- sphinx-gp-theme
- src/sphinx_gp_theme
- theme
- sidebar
- static
- css
- js
- sphinx-ux-autodoc-layout
- src/sphinx_ux_autodoc_layout
- _static
- css
- js
- sphinx-ux-badges
- src/sphinx_ux_badges
- _static/css
- scripts/ci
- tests
- ext
- api_style
- autodoc_argparse
- autodoc_docutils
- autodoc_sphinx
- badges
- fastmcp
- layout
- __snapshots__
- pytest_fixtures
- __snapshots__
- typehints_gp
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| |||
0 commit comments