[DRAFT] DOC Add API example backlinks - #2282
Draft
hugosmoreira wants to merge 2 commits into
Draft
Conversation
Author
|
@microsoft-github-policy-service agree |
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.
Description
Closes #654.
PyRIT's documentation has moved from the Sphinx-based setup described in the original issue to Jupyter Book 2/MyST and the custom
gen_api_md.pygenerator. This updates that generator to build API-to-guide backlinks automatically:doc/myst.ymlJupytext
.pycompanions are used as the analysis source while the generated links continue to point to their.ipynbpages.The analysis is intentionally conservative: star/dynamic imports and instance-method type inference are not guessed. Invalid illustrative snippets are skipped so they cannot break API generation.
Tests and Documentation
python -m pytest tests/unit/build_scripts/test_gen_api_md.py -q --confcutdir=tests/unit/build_scripts— 39 passedruff check build_scripts/gen_api_md.py tests/unit/build_scripts/test_gen_api_md.pyruff format --check build_scripts/gen_api_md.py tests/unit/build_scripts/test_gen_api_md.pyty check build_scripts/gen_api_md.py tests/unit/build_scripts/test_gen_api_md.pypydoc2json.pyandgen_api_md.pymyst.ymlreferencesNo documentation source notebooks changed, so Jupytext execution was not applicable.
Disclosure: I used Codex as a coding assistant while implementing and validating this change. I reviewed the patch and generated output and will own any follow-up changes from review.