Automatically generate CLI reference documentation via sphinx-click and a custom directive#355
Merged
Merged
Conversation
ryanking13
reviewed
May 27, 2026
ryanking13
left a comment
Member
There was a problem hiding this comment.
Thanks! Would it be able to hide some of the subcommands from the generation? I intentionally not included build-recipes, build-recipes-no-deps, skeleton subcommands as I don't want to distract users with recipe-related commands. Most of the users who are looking at that document don't need to be aware of the recipe.
Member
Author
|
Done! I also updated the config variables table since it was a bit outdated. Also, I'll open an issue to reorganise the documentation using Diátaxis. |
ryanking13
approved these changes
May 28, 2026
ryanking13
left a comment
Member
There was a problem hiding this comment.
Thanks! I left some minor comments, otherwise looks good to me
Co-Authored-By: Gyeongjae Choi <def6488@gmail.com>
Member
Author
|
Thanks! Done! |
Copilot AI
added a commit
that referenced
this pull request
Jun 3, 2026
After the merge of #355 (which auto-generates CLI docs via sphinx-click), the manually-written Export modes section in reference/cli.md was lost. - Add an `## Export modes` section to docs/reference/cli.md with the reference table for `pyinit`, `requested`, and `whole_archive` modes, plus a note on comma-separated symbol lists. A MyST label `(export-modes)=` is added so the section can be linked by anchor. - Update the `--exports` Click help text in cli/build.py to concisely describe all four input forms; this text also appears in the auto-generated sphinx-click block. - Update the link in tutorials/c-extension.md to use the `#export-modes` anchor so it lands directly on the new section.
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.
I noticed in #350 that our CLI reference page is likely to get outdated often, as we may forget to update it with new CLI flags and subcommands being added. This PR introduces an inline Sphinx extension with a directive that scans entry points added by
pyodide-buildinpyodide-cliand adds them to the page. See the PR preview: https://pyodide-build--355.org.readthedocs.build/en/355/reference/cli.htmlWe can also skip such automation if we want, but based on my experience writing customisations for the Sphinx build process, this will remain fairly stable and shouldn't break in the future. It also beats adding new commands manually, so I recommend keeping it :D
The extension doesn't support Sphinx 9 yet, as I noticed from this issue that I encountered: click-contrib/sphinx-click#159, which has a PR to fix it: click-contrib/sphinx-click#160. We don't need any cutting-edge features from Sphinx anyway and none of our extensions imposes a Sphinx >=9 bound, so we should be fine with 8.x. Also, the extension doesn't support Markdown, but that's easily workaroundable with
{eval-rst}: click-contrib/sphinx-click#127.Lastly, I dropped the
requirements-doc.txtfile, as it's kind of redundant with dependency groups now.