Skip to content

Split the generated API reference into one page per module - #111

Merged
hey-august merged 4 commits into
mainfrom
august-20260924-725-one-page-per-module
Oct 8, 2026
Merged

hey-august merged 4 commits into
mainfrom
august-20260924-725-one-page-per-module

Conversation

@hey-august

@hey-august hey-august commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

The generated API reference at signalwire.github.io/signalwire-python currently publishes one page per top-level package. Because these are such large surfaces, the generated pages are excessively large. The largest are currently the rest page, at 6.7 MB, and core, at 3.4 MB. These page sizes hindered usability by both humans and agents.

This PR splits the reference into one page per public module at api/<package>/<module>.html, with an index page for each package (docstring plus __all__ and module tables) and a root api/index.html for the lazy top-level exports. That URL scheme is frozen: the Fern retirement (signalwire/docs#735) will redirect to it.

  • reference/gen.sh enumerates modules statically with griffe instead of importing the package. It skips cli, mcp_gateway, private modules, and 21 deprecated re-export shims (any module whose AST has a top-level warnings.warn(..., DeprecationWarning)). Prefabs render public classes only.
  • Three Example: headings in signalwire/__init__.py become Examples:, the form griffe recognises. Without this the doctest rendered as Markdown and broke the strict build.
  • Comments in mkdocs.yml and reference-check.yml updated to match.

Result: 165 pages, median 136 KB. Six pages are still over 500 KB, all *_types_generated TypedDict modules; signalwire/docs#727 handles those. Largest hand-written page is core/function_result.html at 326 KB.

Part of signalwire/docs#724. Closes signalwire/docs#725.

Testing

  • reference/gen.sh runs a strict mkdocs build with no warnings (167 HTML pages).
  • Verified no pages exist under api/cli/, api/mcp_gateway/, for any _private module, or for the shims; api/rest/namespaces/ contains only *_generated pages and its index.
  • Page-size table over _site/api/: every page over 500 KB is a *_generated module.
  • --no-build, --no-install, --help, and the empty-site guard still work.

Checklist

Check off each item:

  • bash scripts/run-ci.sh passes locally
    • passed in CI
  • New tests assert on content (not only "does not raise" / "is not None")
    • n/a, no new tests
  • New test functions are type-annotated (mypy covers tests/)
    • n/a, no new tests

Does this change public API?

Check one:

  • No
  • Yes: naming it here so a maintainer can land the matching
    infrastructure change:

Changing something that goes on the wire?

No. The only source edit is three docstring headings.

@hey-august
hey-august merged commit 8c48e79 into main Oct 8, 2026
6 checks passed
@hey-august
hey-august deleted the august-20260924-725-one-page-per-module branch October 8, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python Server SDK: split the generated reference into one page per module

1 participant