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

Handle Sphinx data type #1917

Merged
merged 28 commits into from
Sep 6, 2024
Merged

Handle Sphinx data type #1917

merged 28 commits into from
Sep 6, 2024

Conversation

Eric-Arellano
Copy link
Collaborator

@Eric-Arellano Eric-Arellano commented Sep 6, 2024

Closes #1401 and #935.

We reuse <Attribute>, which actually works out quite well! It understands how to parse when the data object has a value assigned to it like = "my_value". It can also properly detect isDedicatedPage.

image

There is one weird edge case: Qiskit was improperly using .. py:data:: inside a table in utils.mdx. Naively, it would cause issues with trying to render the component inside the table, which does not work. I fixed it in Qiskit main, but it would be too time consuming to fix on 0.35+. So, we now have a line to skip over converting to an Attribute Component if the element is inside a table. That means the table will continue to render the same as before on those historical docs - the biggest downside is that anchor links still will be broken for the page.

Screenshot 2024-09-06 at 9 40 51 AM

A follow up will simplify our linters like checking for orphan pages, since this PR fixes a lot of those problems.

Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@Eric-Arellano Eric-Arellano added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit 1d89837 Sep 6, 2024
3 checks passed
@Eric-Arellano Eric-Arellano deleted the EA/sphinx-data branch September 6, 2024 14:22
github-merge-queue bot pushed a commit that referenced this pull request Sep 6, 2024
Follow up to #1917. That
resulted in some pages having their behavior fixed, so we can be more
strict in our API lints.

This PR also makes some bigger improvements to the checks:

* Runs `check:metadata` in CI, thanks to a new allowlist
* Simplifies `check:orphan-pages` to have an `--apis` arg
* DRYs our ignore list for `check:internal-links`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Properly support global variables in API docs (.. py:data::)
2 participants