Repository navigation
Split the generated API reference into one page per module - #111
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
restpage, at 6.7 MB, andcore, 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 rootapi/index.htmlfor the lazy top-level exports. That URL scheme is frozen: the Fern retirement (signalwire/docs#735) will redirect to it.reference/gen.shenumerates modules statically with griffe instead of importing the package. It skipscli,mcp_gateway, private modules, and 21 deprecated re-export shims (any module whose AST has a top-levelwarnings.warn(..., DeprecationWarning)). Prefabs render public classes only.Example:headings insignalwire/__init__.pybecomeExamples:, the form griffe recognises. Without this the doctest rendered as Markdown and broke the strict build.mkdocs.ymlandreference-check.ymlupdated to match.Result: 165 pages, median 136 KB. Six pages are still over 500 KB, all
*_types_generatedTypedDict modules; signalwire/docs#727 handles those. Largest hand-written page iscore/function_result.htmlat 326 KB.Part of signalwire/docs#724. Closes signalwire/docs#725.
Testing
reference/gen.shruns a strictmkdocs buildwith no warnings (167 HTML pages).api/cli/,api/mcp_gateway/, for any_privatemodule, or for the shims;api/rest/namespaces/contains only*_generatedpages and its index._site/api/: every page over 500 KB is a*_generatedmodule.--no-build,--no-install,--help, and the empty-site guard still work.Checklist
Check off each item:
bash scripts/run-ci.shpasses locallymypycoverstests/)Does this change public API?
Check one:
infrastructure change:
Changing something that goes on the wire?
No. The only source edit is three docstring headings.