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

Module API pages should not include h1 in their page table of contents #932

Closed
Tracked by #479
Eric-Arellano opened this issue Feb 29, 2024 · 1 comment · Fixed by #949
Closed
Tracked by #479

Module API pages should not include h1 in their page table of contents #932

Eric-Arellano opened this issue Feb 29, 2024 · 1 comment · Fixed by #949

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented Feb 29, 2024

We hardcode that API docs always should show h1 - h3 in the right table of contents, whereas the default is to only show h2 - h3.

in_page_toc_min_heading_level: 1

We do this because it's useful for API class pages, where it's nice to have the class name show up in the right table of contents. That's useful as a way to quickly jump to the class definition because it is non-trivial, like including the constructor and class docstring.

Screenshot 2024-02-29 at 11 08 07 AM

However, that is a bad default for module pages like https://docs.quantum.ibm.com/api/qiskit/exceptions where the page title is not very informative.

Screenshot 2024-02-29 at 11 10 01 AM

Instead, for module pages, we should keep the default of h2 being the min level to show. We should also show h4 because these module pages often have nested information that is worth rendering, although we need to preview a few pages to see what this looks like and confirm it's a good heuristic.

@Eric-Arellano
Copy link
Collaborator Author

All module pages with h4s:

❯ rg '#### ' -l | xargs rg -l 'python_api_type: module' | sort
docs/api/qiskit-ibm-provider/0.7/qiskit_ibm_provider.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-provider/0.8/qiskit_ibm_provider.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-provider/0.9/qiskit_ibm_provider.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-runtime/0.18/qiskit_ibm_runtime.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-runtime/0.19/qiskit_ibm_runtime.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.transpiler.passes.scheduling.md
docs/api/qiskit-ibm-runtime/qiskit_ibm_runtime.transpiler.passes.scheduling.md
docs/api/qiskit/0.19/circuit_library.md
docs/api/qiskit/0.24/circuit_library.md
docs/api/qiskit/0.24/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.25/circuit_library.md
docs/api/qiskit/0.25/providers.md
docs/api/qiskit/0.25/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.26/circuit_library.md
docs/api/qiskit/0.26/providers.md
docs/api/qiskit/0.26/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.27/circuit_library.md
docs/api/qiskit/0.27/providers.md
docs/api/qiskit/0.27/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.28/circuit_library.md
docs/api/qiskit/0.28/providers.md
docs/api/qiskit/0.28/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.29/circuit_library.md
docs/api/qiskit/0.29/providers.md
docs/api/qiskit/0.29/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.30/circuit_library.md
docs/api/qiskit/0.30/providers.md
docs/api/qiskit/0.30/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.31/circuit_library.md
docs/api/qiskit/0.31/providers.md
docs/api/qiskit/0.31/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.32/circuit_library.md
docs/api/qiskit/0.32/providers.md
docs/api/qiskit/0.32/qiskit.chemistry.drivers.gaussiand.md
docs/api/qiskit/0.33/circuit_library.md
docs/api/qiskit/0.33/providers.md
docs/api/qiskit/0.33/qpy.md
docs/api/qiskit/0.33/transpiler_plugins.md
docs/api/qiskit/0.35/circuit_library.md
docs/api/qiskit/0.35/providers.md
docs/api/qiskit/0.35/qpy.md
docs/api/qiskit/0.35/transpiler_plugins.md
docs/api/qiskit/0.35/utils.md
docs/api/qiskit/0.36/circuit_library.md
docs/api/qiskit/0.36/providers.md
docs/api/qiskit/0.36/qpy.md
docs/api/qiskit/0.36/transpiler_plugins.md
docs/api/qiskit/0.36/utils.md
docs/api/qiskit/0.37/circuit_library.md
docs/api/qiskit/0.37/providers.md
docs/api/qiskit/0.37/qpy.md
docs/api/qiskit/0.37/transpiler_plugins.md
docs/api/qiskit/0.37/utils.md
docs/api/qiskit/0.38/circuit_library.md
docs/api/qiskit/0.38/providers.md
docs/api/qiskit/0.38/qpy.md
docs/api/qiskit/0.38/transpiler_plugins.md
docs/api/qiskit/0.38/utils.md
docs/api/qiskit/0.39/circuit_library.md
docs/api/qiskit/0.39/providers.md
docs/api/qiskit/0.39/qpy.md
docs/api/qiskit/0.39/transpiler_synthesis_plugins.md
docs/api/qiskit/0.39/utils.md
docs/api/qiskit/0.40/algorithms.md
docs/api/qiskit/0.40/circuit_library.md
docs/api/qiskit/0.40/providers.md
docs/api/qiskit/0.40/qpy.md
docs/api/qiskit/0.40/tools.md
docs/api/qiskit/0.40/transpiler.md
docs/api/qiskit/0.40/transpiler_synthesis_plugins.md
docs/api/qiskit/0.40/utils.md
docs/api/qiskit/0.41/algorithms.md
docs/api/qiskit/0.41/providers.md
docs/api/qiskit/0.41/qpy.md
docs/api/qiskit/0.41/tools.md
docs/api/qiskit/0.41/transpiler.md
docs/api/qiskit/0.41/transpiler_synthesis_plugins.md
docs/api/qiskit/0.41/utils.md
docs/api/qiskit/0.42/algorithms.md
docs/api/qiskit/0.42/providers.md
docs/api/qiskit/0.42/qpy.md
docs/api/qiskit/0.42/tools.md
docs/api/qiskit/0.42/transpiler.md
docs/api/qiskit/0.42/transpiler_synthesis_plugins.md
docs/api/qiskit/0.42/utils.md
docs/api/qiskit/0.43/algorithms.md
docs/api/qiskit/0.43/providers.md
docs/api/qiskit/0.43/qpy.md
docs/api/qiskit/0.43/tools.md
docs/api/qiskit/0.43/transpiler.md
docs/api/qiskit/0.43/transpiler_synthesis_plugins.md
docs/api/qiskit/0.43/utils.md
docs/api/qiskit/0.44/algorithms.md
docs/api/qiskit/0.44/providers.md
docs/api/qiskit/0.44/qpy.md
docs/api/qiskit/0.44/transpiler.md
docs/api/qiskit/0.44/transpiler_synthesis_plugins.md
docs/api/qiskit/0.44/utils.md
docs/api/qiskit/0.45/algorithms.md
docs/api/qiskit/0.45/providers.md
docs/api/qiskit/0.45/qpy.md
docs/api/qiskit/0.45/transpiler.md
docs/api/qiskit/0.45/transpiler_synthesis_plugins.md
docs/api/qiskit/0.45/utils.md
docs/api/qiskit/0.46/algorithms.md
docs/api/qiskit/0.46/providers.md
docs/api/qiskit/0.46/qpy.md
docs/api/qiskit/0.46/transpiler.md
docs/api/qiskit/0.46/transpiler_synthesis_plugins.md
docs/api/qiskit/0.46/utils.md
docs/api/qiskit/circuit_classical.md
docs/api/qiskit/dev/circuit_classical.md
docs/api/qiskit/dev/providers.md
docs/api/qiskit/dev/qpy.md
docs/api/qiskit/dev/transpiler.md
docs/api/qiskit/dev/transpiler_synthesis_plugins.md
docs/api/qiskit/dev/utils.md
docs/api/qiskit/providers.md
docs/api/qiskit/qpy.md
docs/api/qiskit/transpiler.md
docs/api/qiskit/transpiler_synthesis_plugins.md
docs/api/qiskit/utils.md

@Eric-Arellano Eric-Arellano self-assigned this Mar 4, 2024
@Eric-Arellano Eric-Arellano moved this to In Review in Docs Planning Mar 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 4, 2024
Closes #932.

We decided:

1. We are going to keep showing h1s for class and function pages. It's
useful because they have non-trivial code at the top level, like their
docstring and constructor. It's nice to have the quick way to access the
value.
2. For now at least, we won't show h4s in the module pages. There are 8
module pages in the current API docs that use h4s. I think showing h4s
improved ~3 of them, and made ~5 worse. So, for now, let's not include
them. This can be revisited, especially after
#942.

This regens all APIs but reverts dev docs, which have unrelated changes
and will be regenerated in a dedicated PR.
@github-project-automation github-project-automation bot moved this from In Review to Done in Docs Planning Mar 4, 2024
frankharkins pushed a commit to frankharkins/documentation that referenced this issue Jul 22, 2024
Closes Qiskit#932.

We decided:

1. We are going to keep showing h1s for class and function pages. It's
useful because they have non-trivial code at the top level, like their
docstring and constructor. It's nice to have the quick way to access the
value.
2. For now at least, we won't show h4s in the module pages. There are 8
module pages in the current API docs that use h4s. I think showing h4s
improved ~3 of them, and made ~5 worse. So, for now, let's not include
them. This can be revisited, especially after
Qiskit#942.

This regens all APIs but reverts dev docs, which have unrelated changes
and will be regenerated in a dedicated PR.
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