|
2 | 2 |
|
3 | 3 | # Architecture |
4 | 4 |
|
5 | | -Twelve workspace packages in three tiers. Lower layers never depend on |
6 | | -higher ones — domain packages consume shared infrastructure, and the |
| 5 | +Workspace packages organized in tiers. Lower layers never depend on |
| 6 | +higher ones — autodoc extensions consume shared infrastructure, and the |
7 | 7 | presentation layer wires everything together for downstream projects. |
8 | 8 |
|
9 | | -The sidebar groups these twelve packages into four navigation buckets |
10 | | -(Domain Packages, UX, Utils, Internal) — a reader-facing grouping that |
11 | | -is orthogonal to the dependency-ordered tier map below. |
| 9 | +The sidebar groups these packages into navigation buckets (Domain Packages, |
| 10 | +UX, Utils, Internal) — a reader-facing grouping that is orthogonal to the |
| 11 | +dependency-ordered tier map below. |
12 | 12 |
|
13 | 13 | ## Tier 1: Shared infrastructure |
14 | 14 |
|
15 | | -The rendering pipeline that all domain packages consume: |
| 15 | +The rendering pipeline that every autodoc extension consumes: |
16 | 16 |
|
17 | 17 | ::::{grid} 1 1 3 3 |
18 | 18 | :gutter: 2 |
@@ -43,39 +43,121 @@ Replaces `sphinx-autodoc-typehints` + `sphinx.ext.napoleon`. |
43 | 43 |
|
44 | 44 | :::: |
45 | 45 |
|
46 | | -## Tier 2: Domain packages |
| 46 | +## Tier 2: Autodoc extensions |
47 | 47 |
|
48 | | -Domain-specific autodoc extensions that consume Tier 1 and add |
49 | | -project-specific rendering logic: |
| 48 | +Domain-specific [autodoc extensions](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) |
| 49 | +that consume Tier 1 and add project-specific rendering logic. Each |
| 50 | +ships directives that generate documentation from a particular |
| 51 | +source-construct family: |
50 | 52 |
|
51 | | -| Package | Domain | Directives | |
52 | | -|---------|--------|------------| |
53 | | -| {doc}`sphinx-autodoc-api-style <packages/sphinx-autodoc-api-style>` | Standard Python | `autofunction`, `autoclass`, `automodule` | |
54 | | -| {doc}`sphinx-autodoc-argparse <packages/sphinx-autodoc-argparse>` | Custom `argparse` domain — programs, options, subcommands, positionals | `argparse` | |
55 | | -| {doc}`sphinx-autodoc-docutils <packages/sphinx-autodoc-docutils>` | docutils | `autodirective`, `autorole` | |
56 | | -| {doc}`sphinx-autodoc-fastmcp <packages/sphinx-autodoc-fastmcp>` | FastMCP tools | `fastmcp-tool`, `fastmcp-tool-summary` | |
57 | | -| {doc}`sphinx-autodoc-pytest-fixtures <packages/sphinx-autodoc-pytest-fixtures>` | pytest fixtures (extends `py` domain) | `autofixture`, `autofixtures`, `auto-pytest-plugin` | |
58 | | -| {doc}`sphinx-autodoc-sphinx <packages/sphinx-autodoc-sphinx>` | Sphinx config | `autoconfigvalue`, `autoconfigvalues` | |
| 53 | +::::{grid} 1 1 2 3 |
| 54 | +:gutter: 2 |
| 55 | + |
| 56 | +:::{grid-item-card} sphinx-autodoc-api-style |
| 57 | +:link: packages/sphinx-autodoc-api-style |
| 58 | +:link-type: doc |
| 59 | + |
| 60 | +**Subject**: standard Python. |
| 61 | +**Directives**: `autofunction`, `autoclass`, `automodule`. |
| 62 | +::: |
| 63 | + |
| 64 | +:::{grid-item-card} sphinx-autodoc-argparse |
| 65 | +:link: packages/sphinx-autodoc-argparse |
| 66 | +:link-type: doc |
| 67 | + |
| 68 | +**Subject**: argparse parsers — programs, options, subcommands, positionals. |
| 69 | +**Directives**: `argparse` (custom `argparse` domain). |
| 70 | +::: |
| 71 | + |
| 72 | +:::{grid-item-card} sphinx-autodoc-docutils |
| 73 | +:link: packages/sphinx-autodoc-docutils |
| 74 | +:link-type: doc |
| 75 | + |
| 76 | +**Subject**: docutils directives and roles. |
| 77 | +**Directives**: `autodirective`, `autorole`. |
| 78 | +::: |
| 79 | + |
| 80 | +:::{grid-item-card} sphinx-autodoc-fastmcp |
| 81 | +:link: packages/sphinx-autodoc-fastmcp |
| 82 | +:link-type: doc |
| 83 | + |
| 84 | +**Subject**: FastMCP tools, prompts, resources. |
| 85 | +**Directives**: `fastmcp-tool`, `fastmcp-tool-summary`. |
| 86 | +::: |
| 87 | + |
| 88 | +:::{grid-item-card} sphinx-autodoc-pytest-fixtures |
| 89 | +:link: packages/sphinx-autodoc-pytest-fixtures |
| 90 | +:link-type: doc |
59 | 91 |
|
60 | | -Each domain package calls `app.setup_extension()` to auto-register its |
| 92 | +**Subject**: pytest fixtures (extends the `py` domain). |
| 93 | +**Directives**: `autofixture`, `autofixtures`, `auto-pytest-plugin`. |
| 94 | +::: |
| 95 | + |
| 96 | +:::{grid-item-card} sphinx-autodoc-sphinx |
| 97 | +:link: packages/sphinx-autodoc-sphinx |
| 98 | +:link-type: doc |
| 99 | + |
| 100 | +**Subject**: Sphinx config values. |
| 101 | +**Directives**: `autoconfigvalue`, `autoconfigvalues`. |
| 102 | +::: |
| 103 | + |
| 104 | +:::: |
| 105 | + |
| 106 | +Each autodoc extension calls `app.setup_extension()` to auto-register its |
61 | 107 | infrastructure dependencies — downstream projects only need to add the |
62 | | -domain package to their `extensions` list. |
| 108 | +package to their `extensions` list. |
63 | 109 |
|
64 | 110 | ## Tier 3: Theme and coordinator |
65 | 111 |
|
66 | 112 | | Package | Role | |
67 | 113 | |---------|------| |
68 | 114 | | {doc}`gp-sphinx <packages/gp-sphinx>` | Coordinator. `merge_sphinx_config()` wires up the full stack. | |
69 | 115 | | {doc}`sphinx-gp-theme <packages/sphinx-gp-theme>` | Furo-based theme with CSS variables and SPA navigation. | |
| 116 | +| {doc}`gp-furo-theme <packages/gp-furo-theme>` | Tailwind v4 port of upstream Furo for git-pull projects. | |
70 | 117 | | {doc}`sphinx-fonts <packages/sphinx-fonts>` | IBM Plex via Fontsource — preloaded web fonts. | |
71 | 118 |
|
| 119 | +## Build tooling |
| 120 | + |
| 121 | +Cross-cutting build utilities that operate outside the docs-build |
| 122 | +runtime — one is a [PEP 517](https://peps.python.org/pep-0517/) build |
| 123 | +backend invoked when wheels are produced; the other is an opt-in |
| 124 | +extension that drives the Vite watcher during `sphinx-autobuild`. |
| 125 | +Both let theme authors keep build artefacts (`static/styles/*.css`, |
| 126 | +`static/scripts/*.js`) out of VCS while still shipping working wheels |
| 127 | +and seamless live-reload during authoring. |
| 128 | + |
| 129 | +::::{grid} 1 1 2 2 |
| 130 | +:gutter: 2 |
| 131 | + |
| 132 | +:::{grid-item-card} sphinx-vite-builder |
| 133 | +:link: packages/sphinx-vite-builder |
| 134 | +:link-type: doc |
| 135 | + |
| 136 | +[PEP 517](https://peps.python.org/pep-0517/) build backend (or |
| 137 | +hatchling build hook via `[tool.hatch.build.hooks.vite]`) that runs |
| 138 | +`pnpm exec vite build` before delegating wheel/sdist construction to |
| 139 | +hatchling. Also a Sphinx extension that auto-orchestrates |
| 140 | +`vite build --watch` during `sphinx-autobuild` and one-shot |
| 141 | +`vite build` during plain `sphinx-build`. |
| 142 | +Source builds error loudly without pnpm/Node; wheels ship turn-key. |
| 143 | +**Publishable for use outside this workspace** — any vite + Sphinx |
| 144 | +project can adopt either activation path without depending on the |
| 145 | +gp-sphinx coordinator. |
| 146 | +::: |
| 147 | + |
| 148 | +:::: |
| 149 | + |
72 | 150 | ## How the tiers connect |
73 | 151 |
|
74 | | -Every domain package shares the same badge palette, the same componentized |
75 | | -HTML output structure, and the same type annotation pipeline — so Python |
76 | | -APIs, pytest fixtures, Sphinx config values, docutils directives, and |
77 | | -FastMCP tools all look like they belong together. |
| 152 | +Every autodoc extension shares the same badge palette, the same |
| 153 | +componentized HTML output structure, and the same type annotation |
| 154 | +pipeline — so [Python APIs](packages/sphinx-autodoc-api-style.md), |
| 155 | +[pytest fixtures](packages/sphinx-autodoc-pytest-fixtures.md), |
| 156 | +[Sphinx config values](packages/sphinx-autodoc-sphinx.md), |
| 157 | +[docutils directives](packages/sphinx-autodoc-docutils.md), and |
| 158 | +[FastMCP tools](packages/sphinx-autodoc-fastmcp.md) all look like |
| 159 | +they belong together. |
78 | 160 |
|
79 | 161 | This is the **one autodoc design system** principle: a change to the shared |
80 | | -infrastructure propagates instantly and consistently across all six |
81 | | -domain packages. |
| 162 | +infrastructure propagates instantly and consistently across every autodoc |
| 163 | +extension in the workspace. |
0 commit comments