Repository navigation
docs: add a Python API reference generated from docstrings - #283
Merged
NandhaKishorM merged 1 commit intoSep 24, 2026
Merged
Conversation
The Python API docstrings now have browsable pages under docs/reference/, rendered with mkdocstrings. Handler options keep signatures and multi-line Returns sections readable and put the constructor on the class page without changing the source. The Docs workflow also runs on laya/** so docstring changes rebuild the site.
Owner
|
Thank you, an API reference generated from the docstrings keeps the docs in step with the code without anyone maintaining it by hand. Merging. |
baninaveen
pushed a commit
to baninaveen/laya
that referenced
this pull request
Sep 24, 2026
…horM#283) The Python API docstrings now have browsable pages under docs/reference/, rendered with mkdocstrings. Handler options keep signatures and multi-line Returns sections readable and put the constructor on the class page without changing the source. The Docs workflow also runs on laya/** so docstring changes rebuild the site.
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.
This adds a browsable Python API reference under
docs/reference/, generated from the docstrings with mkdocstrings. It coversAgent,load,ONNXAgent,Router, the language, email, preset, shortlist and calibration helpers, and the LangChain components. The hooks already have a hand-written API page, so the reference links to that. Part of #265.The source stays unchanged. Handler options wrap signatures at 70 characters, put the constructor on the class page, and keep multi-line
Returns:sections together. Ruff formats the signatures, which is why it's inrequirements-docs.txt. The Docs workflow also runs onlaya/**so docstring changes rebuild the site.There are two existing docstrings that list several parameters on one line (
hooks, on_predict_start, on_predict_end:inAgent.predict_batchandONNXAgent). Google style can't split those, so they render as a combined entry. Griffe warns about them, but those warnings don't fail the strict build. Fixing the docstrings is left out of this docs-only PR.This can merge without #282: the landing page links to the reference. With #282, it also appears in the navigation as a Reference section.
zensical build --strictpasses both on its own and combined with #282, with the Griffe warnings noted above.tests/test_packaging.pypasses too.