-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: docgen python apis #2149
docs: docgen python apis #2149
Conversation
I see that there is |
Yeah, I was torn about putting the py docs under I pushed a change to demo what it looks like under If you look at the sidebar, you'll see:
Clicking on Python API Reference cause sit to expand to duplicates of the module names, which are already listed in the TOC. If you click on sphinx.bzl, the sidebar then does a weird thing where both the top-level sphinx.bzl name and the sphinx.bzl name under Python API Reference is highlighted. Oddly, the runfiles.runfiles entry doesn't do this. I'm guessing its some bug (or maybe WAI) in the sidebar code that gets confused when the same document is listed multiple times. This is caused by the api/index TOC using
Of all the alternatives, that last one is the most appealing. WDYT? |
Hmmm. I would love the TOC to be grouped by:
It could be all grouped under a single |
I like that grouping. Autodoc2 only supports a single output directory, but rules_python and sphinxdocs can go into their own dirs. I'll rearrange things. |
Ok, reorganized. PTAL |
The new structure LGTM, is it possible to do some path remapping for old links to still work? I think that is a nice to have. On the other hand, this refactor teaches but on the other hand we should be sharing permalinks when linking to our docs anyway. |
I found a sphinx plugin that can generate redirect HTML files. I mapped the files that previously existing to redirect to their new locations. |
Uses autodoc2 to generate Python documentation for runfiles and sphinx_bzl. This provides some basic API doc for our Python code. They don't look particularly great, yet, but we can work on how they look in another PR. Also: * Fixes position of license rule and extra space in license text * Forces sphinx_rtd_theme >= 2.0. uv kept trying to downgrade it for some reason. * Use directives markup to document the sphinx_bzl directives * Add `sphinx_run` rule to make it easier to run Sphinx interactively for debugging
Uses autodoc2 to generate Python documentation for runfiles and sphinx_bzl.
This provides some basic API doc for our Python code. They don't look particularly great,
yet, but we can work on how they look in another PR.
Also:
sphinx_run
rule to make it easier to run Sphinx interactively for debugging