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.
Deduplicate headers for overloaded methods (Qiskit#895)
Closes Qiskit#167 The script was creating a title for every `<dt>` tag inside a `<dl>` tag. This is almost always correct given that we only have a `<dt>` tag for each method. The problem with overload methods is that we have a `<dt>` for each `@typing.overload` definition. For example, the `quantumcircuit.py` file overloads the definition of for_loop: https://github.com/Qiskit/qiskit/blob/244940a10c17f1dc3d74e2665a3ae869dc3d7291/qiskit/circuit/quantumcircuit.py#L4862-L4884 This is an example of the HTML generated ```html <dl class="py method"> <dt class="sig sig-object py" id="qiskit.circuit.QuantumCircuit.for_loop"> <span class="sig-name descname"><span class="pre">for_loop</span> <dt class="sig sig-object py"> <span class="sig-name descname"><span class="pre">for_loop</span> <dd><p>Create a <code class="docutils literal notranslate"><span class="pre">for</span></code> loop on this circuit.</p> ``` To solve the problem this PR adds an extra condition to check whether the `<dt>` tag has an id or not. Only the first `<dt>` tag will have an id, so we can use this fact to create only one `<h3>` for each method.
- Loading branch information
1 parent
52b341b
commit 34fd8e3
Showing
30 changed files
with
4 additions
and
348 deletions.
There are no files selected for viewing
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
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
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
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.