forked from Qiskit/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API generation script uses MDX components (Qiskit#1026)
Part of Qiskit#1008 This PR teaches our API generation script to generate MDX components that will define the styling of the classes, properties, attributes, methods, functions, and exceptions. The script will generate custom tags to wrap all the content and store useful information as props. This is an example of git diff for an Attribute: ```diff - ### dtm - Return the system time resolution of output signals :returns: The output signal timestep in seconds. :rtype: dtm + ### dtm + <Attribute id="qiskit_ibm_provider.IBMBackend.dtm" name="dtm"> + Return the system time resolution of output signals :returns: The output signal timestep in seconds. :rtype: dtm + </Attribute> ``` The script continues generating headers for every apiType that needs it, but this will be removed in a follow-up. ### Details The PR adds a new script named `generateMdxComponents.ts` that will generate all the components. The main function is `processMdxComponent` where we prepare the necessary props for each component and then return an open tag and a closed tag ready for its use. To process the new tags, new handlers have been added to `htmlToMd.ts`. --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
- Loading branch information
1 parent
1d651db
commit caf0d0c
Showing
9 changed files
with
617 additions
and
464 deletions.
There are no files selected for viewing
286 changes: 129 additions & 157 deletions
286
scripts/lib/api/__snapshots__/conversionPipeline.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Oops, something went wrong.