Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Function component for API docs redesign #1008

Closed
3 of 4 tasks
Eric-Arellano opened this issue Mar 11, 2024 · 0 comments · Fixed by #1026
Closed
3 of 4 tasks

Set up Function component for API docs redesign #1008

Eric-Arellano opened this issue Mar 11, 2024 · 0 comments · Fixed by #1026

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented Mar 11, 2024

Part of #479. We're going to start with adding an MDX component for Functions before adding the more complex class/method components, since functions don't have to deal as much with nesting. Functions are always top-level.

  • Teach our API generation script to generate <Function>
  • MDX will add a span id for the full path:

<span id="qiskit.utils.add_deprecation_to_docstring" />

It is not yet in scope to worry about indentation, #736. That is lower priority.

Component name

Should it be <Function> or <ApiFunction>?

Eric-Arellano added a commit that referenced this issue Mar 13, 2024
API docs use Markdown components, and are about to use a lot more of
them with the new API components like
#1008. It's confusing to
pretend they're MD files.

This PR makes things consistent, which allows us to simplify some of our
scripts to only deal with MDX and IPYNB extensions.

The API docs were manually changed with this Bash snippet:

```bash
for file in docs/api/**/*.md; do
  if [ -f "$file" ]; then
    mv "$file" "${file%.md}.mdx"
  fi
done
```
github-merge-queue bot pushed a commit that referenced this issue Mar 25, 2024
Part of #1008

This PR is a precursor of #1026, and it creates a new script named
`generateApiComponents.ts` with some tests. This script will have all
the logic to generate the MDX components, but, in the meantime, this PR
adds some functions that can be tested independently by just receiving,
as parameters, a list of props or HTML code.

It also copies over the functions `prepareGitHubLink` and `findByText`
from `processHtml.ts`
@javabster javabster moved this to In Progress in Docs Planning Mar 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
Part of #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>
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
Part of #1008

This PR regenerates qiskit-ibm-runtime API with the design changes
introduced in #1026
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
Part of #1008

This PR regenerates qiskit-ibm-provider API with the design changes
introduced in #1026
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
Part of #1008

This PR regenerates qiskit API with the design changes introduced in
#1026
@arnaucasau arnaucasau linked a pull request Apr 8, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Docs Planning Apr 8, 2024
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
API docs use Markdown components, and are about to use a lot more of
them with the new API components like
Qiskit#1008. It's confusing to
pretend they're MD files.

This PR makes things consistent, which allows us to simplify some of our
scripts to only deal with MDX and IPYNB extensions.

The API docs were manually changed with this Bash snippet:

```bash
for file in docs/api/**/*.md; do
  if [ -f "$file" ]; then
    mv "$file" "${file%.md}.mdx"
  fi
done
```
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Part of Qiskit#1008

This PR is a precursor of Qiskit#1026, and it creates a new script named
`generateApiComponents.ts` with some tests. This script will have all
the logic to generate the MDX components, but, in the meantime, this PR
adds some functions that can be tested independently by just receiving,
as parameters, a list of props or HTML code.

It also copies over the functions `prepareGitHubLink` and `findByText`
from `processHtml.ts`
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
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>
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Part of Qiskit#1008

This PR regenerates qiskit-ibm-runtime API with the design changes
introduced in Qiskit#1026
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Part of Qiskit#1008

This PR regenerates qiskit-ibm-provider API with the design changes
introduced in Qiskit#1026
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Part of Qiskit#1008

This PR regenerates qiskit API with the design changes introduced in
Qiskit#1026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants