Documentation: Automatically generate CLI documentation#130
Merged
Conversation
This directory contains automatically generated API reference, created with 'gen-files' plugin (for the use by 'literate-nav' plugin). Because there will be CLI reference (i.e. command line tools manpages), rename it from docs/reference/ to docs/api_reference/
This change prepares for automatically generating reference documentation for CLI tools, in addition to this script automatically generating API documentation.
The new scripts/gen_cli_ref_pages.py gen-files script assumes that the project is using pyproject.toml to declare (and install) CLI tools. Extracting data from pyproject.toml means that the script should work whether 'patchscope' project is installed or not. This change required adjusting links in docs/cli.md, as now documentation for each CLI tool is on separate page. Hook(s) in scripts/my_hooks.py had to be adjusted to ignore generated documentation for CLI, just like they were ignoring generated documentation for API. Add cli_reference/ to docs/.gitignore, so one can test the gen-files script by running it with `python scripts/gen_cli_ref_pages.py`.
This Unicode character was the reason why mkdocs-typer2 (or the Markdown renderer used by MkDocs) had problems rendering generated documentation for the `diffinsights-web` CLI tool.
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.
Use 'gen-files' MkDocs plugin to automatically generate reference documentation for CLI tools with mkdocs-typer2, similar to how this plugin is used to automatically generate reference API documentation with mkdocstrings.
While at it, fix generating CLI documentation for
diffinsights-web(this is an independent change).