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.
Fix accidental deletion of GitHub source links for methods (Qiskit#940)
Part of Qiskit#517. Turns out that we would accidentally delete all the GitHub links for methods because we were using `closest().remove()` rather than `.closest().first().remove()`. That means that we'd only have the link for the class definition and not individual methods, which defeats the point of precise source code links from Qiskit#517. ## Historical API docs However, the behavior to not show methods is actually quite sensible for our API docs, where we were using `sphinx.ext.viewcode` rather than `sphinx.ext.linkcode`. That meant that we could only link to the overall file, rather than specific line numbers. So, it's not very useful to keep linking to the overall file for every method since they will each have the same value and the class definition already has the value. So, we check if the link is for a method and proactively remove it if so. This change to proactively remove method links changes some historical API doc versions, but not others. Why? It only removes the links if we were doing method inlining, where the method had a dedicated HTML page originally. That's because the `.remove()` line wouldn't impat the distinct HTML pages.
- Loading branch information
1 parent
6b64016
commit e497785
Showing
7,678 changed files
with
31,075 additions
and
31,045 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
Oops, something went wrong.