Skip to content

Commit b2b2f8d

Browse files
committed
docs(feat[autodoc]): Add sphinx-autodoc-docutils, sphinx-autodoc-sphinx, and package-reference directive
why: Enable auto-generated reference tables for directives, roles, and config values across all package docs pages, replacing static Markdown tables with live introspection. what: - Add sphinx-autodoc-docutils package with autodirective, autorole, autodirective-index, autorole-index directives - Add sphinx-autodoc-sphinx package with autoconfigvalue, autoconfigvalues, autoconfigvalue-index directives - Add package_reference.py docs extension (auto-generates registered surface tables from setup() introspection) - Rewrite all package docs pages to use live autodoc directives - Add argparse_neo_demo.py with subcommand and epilog examples - Register new extensions in conf.py with env-gated intersphinx - Add workspace packages to pyproject.toml, ruff, and mypy config - Add tests for autodoc-docutils, autodoc-sphinx, and package-reference - Add CSS for package demo cards and font specimens - Add redirects for new package doc pages
1 parent 2ac805c commit b2b2f8d

38 files changed

+2873
-531
lines changed

docs/_ext/argparse_neo_demo.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"""Demo parser factories for the sphinx-argparse-neo docs page."""
2+
3+
from __future__ import annotations
4+
5+
import argparse
6+
import textwrap
7+
8+
9+
def build_parser() -> argparse.ArgumentParser:
10+
"""Return a parser with groups, subcommands, and example epilogs."""
11+
parser = argparse.ArgumentParser(
12+
prog="gp-demo",
13+
description="Inspect and synchronize documentation metadata.",
14+
)
15+
parser.add_argument(
16+
"--format",
17+
choices=["table", "json"],
18+
default="table",
19+
help="output format",
20+
)
21+
parser.add_argument(
22+
"--jobs",
23+
type=int,
24+
default=4,
25+
help="number of worker jobs",
26+
)
27+
28+
subcommands = parser.add_subparsers(dest="command")
29+
30+
sync = subcommands.add_parser(
31+
"sync",
32+
help="synchronize package docs",
33+
description="Synchronize package metadata into the docs site.",
34+
epilog=textwrap.dedent(
35+
"""
36+
examples:
37+
gp-demo sync packages/sphinx-fonts
38+
gp-demo sync packages/sphinx-gptheme
39+
40+
Machine-readable output examples:
41+
gp-demo sync --format json packages/sphinx-fonts
42+
"""
43+
),
44+
formatter_class=argparse.RawDescriptionHelpFormatter,
45+
)
46+
sync.add_argument("target", metavar="PACKAGE", help="package to synchronize")
47+
sync.add_argument(
48+
"--strict",
49+
action="store_true",
50+
help="fail on missing docs coverage",
51+
)
52+
53+
doctor = subcommands.add_parser(
54+
"doctor",
55+
help="check docs build health",
56+
description="Run validation checks for the documentation site.",
57+
)
58+
doctor.add_argument(
59+
"--warnings-as-errors",
60+
action="store_true",
61+
help="treat warnings as fatal",
62+
)
63+
64+
return parser

0 commit comments

Comments
 (0)