Adds Qiskit addon prose content pipeline #5046
Open
eharvey328 wants to merge 131 commits into
Open
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Extracts prose HTML and Jupyter notebooks for Qiskit addons and converts them to MDX to be consumed by our docs app. The goal is to extend the existing API docs pipeline for minimal changes.
npm run gen-addon -- -p {package}npm run gen-api -- -p {package} -v {version}Why a separate pipeline instead of reusing the API pipeline
runApiDocsPipeline) targetsapidocs/**stubs and generatesdocs/api/{pkg}/..ipynb) under the Sphinx root — no stubs, nohistorical versioning, no release notes per-page.
(
pipelineStages.ts,notebookStages.ts) but diverges in:apidocs/**,stubs/**docs/api/{pkg}/docs/addons/{pkg}/public/docs/images/api/public/docs/images/addons/generateToc.tsgenerateAddonToc.ts<h1>latest/historical/devlatestonlyNew files
scripts/js/lib/api/addonDocsPipeline.tsscripts/js/lib/api/pipelineStages.tsconversionPipeline.ts; used by both pipelinesscripts/js/lib/api/notebookStages.tsscripts/js/lib/api/generateAddonToc.ts_toc.jsonwith back-link, API referencescripts/js/commands/api/updateAddonDocs.ts--package,--versionscripts/js/commands/api/updateDocsShared.tsupdateApiDocs.tsscripts/js/lib/api/apiDocsPipeline.tsconversionPipeline.ts; API pipeline now lives hereDesign decisions
extractfrontMatter=truein addon pipeline: Addons don't follow the same URL-slug naming convention as API stubs, so URL-derived titles were wrong. Extracting from<h1>is more reliable._tocto provide text for the parent back arrow (link) in the toc. Added as a new property for backwards compatibility with learning content.objects.invfiles for cross-package link resolution: Addon notebooks link to symbols in other packages (qiskit.github.io/{pkg}/stubs/...). The old pipeline only resolved links against the current package's inventory, which isn't enough for addons.ObjectsInv.loadPublishedApis(publicBaseFolder)first, which scanspublic/docs/api/on disk and returns aMap<pkgName, ObjectsInv>for every package that has a published inventory. That map flows down throughpostProcess→updateLinksandprocessNotebooks→rewriteNotebookLinks, whereresolveStubUrl(url, allInvs)uses it to look up the right package's inventory by name.resolveStubUrlhandles two URL forms:stubs/{Symbol}— entry lookup by name; the entry'surialready carries the correct anchor.apidocs/{page}— page-level lookup; the source#anchoris preserved and appended.std:domain guard inshouldIncludeEntry— excludes non-API entries (guide pages, index, install) from published inventories so they can't produce false cross-package matches.