Repository navigation
feat(reference): one API reference page per package, re-exports as tables - #9
Conversation
…bles
The reference rendered each top-level module with all its submodules
on one page: appinfra.app came to ~3 MB and took over a second to load,
and every re-exported class was documented in full under each package
that exported it.
- docsite/reference.py: a page per package and subpackage at every
depth, nested in the nav the way the packages nest; a package's own
.py files get no pages. Each page links its subpackages. The API
reference page renders the package's top level the same way.
- docsite/reexports.py (griffe extension): a package's export that
another public package defines and exports is taken off its page and
listed in an Exports table in the docstring, linked to where it is
documented. Everything else the package exports is documented in
full on its page. Subpackages are found by is_init_module: griffe's
is_package is true only for the top-level package.
- zensical.base.toml: show_submodules = false and filters ["!^_"], so
a page holds only its package's public members.
- overrides/mkdocstrings: each package-level class, function,
attribute and type alias shows its import line (">>> from <package>
import <name>") at the right of its heading, highlighted, with the
theme's copy button.
- docsite/docstring_code.py: examples that parse as Python are shown
as console sessions (>>> and ...), like the ones written as
doctests. Copying a session leaves out its prompts and output.
- pages/assets/extra.css: code is 13.6px everywhere; in tables and
example boxes the theme's em sizing made it 10.9px.
appinfra.app's page is now ~17,000 px tall and loads in 0.1 s; the
largest page is 343 KB.
Signed-off-by: serendip-ml <64741025+serendip-ml@users.noreply.github.com>
Signed-off-by: serendip-ml <64741025+serendip-ml@users.noreply.github.com>
|
No actionable comments were generated in the recent review. WalkthroughThe API reference now follows nested public packages, documents qualifying re-exports in tables, and renders Python examples as interactive sessions. API object pages also show copyable import lines. Package navigation and reference tests reflect the updated page structure. ChangesAPI Reference Generation and Rendering
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Merge Risk:
|
The generated API reference put each top-level module and all its submodules on one page (appinfra.app came to ~3 MB and over a second to load), and documented every re-exported class in full under each package that exported it.
Reference structure
docsite/reference.py). A package's own.pyfiles get no pages; its API is what its__init__exports. Each page links its subpackages, and the API reference page renders the package's top level the same way.docsite/reexports.py, a griffe extension). A name a package exports that another public package defines and exports is listed in an Exports table, linked to the page where it is documented. Everything else the package exports is documented in full on its page.show_submodules = falseandfilters = ["!^_"]: a page holds only its package's public members.Page details
>>> from <package> import <name>at the right of its heading, highlighted, with the theme's copy button (template overrides inoverrides/mkdocstrings).>>>and..., like the ones written as doctests. Copying a session leaves out prompts and output.Package order
Packages are listed from agents down to the foundation (llm-gent, llm-kelt, llm-saia, llm-infer, appinfra) in the nav and on the home and Packages pages.
Result
All 105 pages load in under 220 ms locally (median 42 ms). The largest reference page is 343 KB; appinfra.app's page is ~17,000 px tall and loads in 0.1 s.
Summary by CodeRabbit
New Features
Documentation