Repository navigation
docs: describe API pages in their titles and link the Library - #66
Merged
Merged
Conversation
An API reference page had its module's bare name as its <title> and the site's description as its meta description, so a search result for it read "qiskit_aer_backend - eigenkit" over a sentence about the whole library. docs/gen_ref_pages.py now writes both from the module's docstring as front matter, and overrides/main.html reads the title from `html_title`, so the page's heading, its label in the navigation and the site search keep the short module name. A module with no docstring of its own (hhl, iqae, qsvc, hqnc and others) is described by the class it is named after. The "Algorithms Explained" pages each point to the EigenOrbit Library page on the same method, which says when the method is worth using and shows it against a classical baseline.
|
Docs preview: https://pr-66.eigenkit-docs.pages.dev |
This branch was successfully deployed
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.
Summary
An API reference page had its module's bare name as the
<title>and the site-wide description as its meta description, so a search result for it said nothing about the page. Each generated page now takes both from its module's docstring. The "Algorithms Explained" pages also point to the EigenOrbit Library page on the same method.api/core/backends/qiskit_aer_backend/qiskit_aer_backend - eigenkitqiskit_aer_backend: The Qiskit Aer backend | eigenkit APIapi/chemistry/ansatz/ansatz - eigenkitansatz: Ansatz building blocks for chemistry circuits | eigenkit APIapi/qml/qsvr/qsvr - eigenkitqsvr: Quantum support vector regressor (QSVR) | eigenkit APIapi/torch/estimators/hqnc/hqnc - eigenkithqnc: Hybrid quantum neural network classifier (HQNC) | eigenkit APIThe description of each of these was "eigenkit is an open-source Python library for quantum computing and quantum machine learning. Write an algorithm once, run it on any simulator or QPU." It is now the opening of the module's docstring, for example "The Qiskit Aer backend, with the statevector and matrix product state (MPS) methods."
How
docs/gen_ref_pages.pywriteshtml_titleanddescriptionas front matter of every generated page. A module with no docstring of its own (hhl,iqae,qsvc,qsvr,hqnc,hqnrand five more) is described by the class it is named after.overrides/main.htmlreadshtml_titlefor<title>,og:titleandtwitter:title. Front mattertitleis not used: it would also replace the short module name in the header and in the site search.docs/algorithms/that has a matching Library page gets one sentence in its "Next" section: 11 links on 7 pages, and one sentence on the section's index. The ansatz page thatvqe.mdlinks is being published now; the other ten links are live.What stays as it was
llms.txtand the markdown copy of every API page:html_titleappears in no built file.Known rough edges
api/core/variational/keeps a fallback title,eigenkit.core.variational API reference | eigenkit: its summary line holds a formula.api/core/ir/andapi/photonics/ir/get the same title,ir: The intermediate representation | eigenkit API.A better summary line in the module's docstring fixes any of these.
Test plan
uv run pytestpasses (in CI, on every platform; not run locally, since no test coversdocs/)uv run pre-commit run --all-filesis cleanuv run mkdocs build --strictpasses (if docs changed)tools/docs-checks/exit 0main: on the API pages only the title, description, Open Graph and Twitter tags differ; no title or description is emptyRelated issues
None.