Skip to content

Commit

Permalink
Merge branch 'mlapson/switch-to-sphinx-ext-linkcode' of https://githu…
Browse files Browse the repository at this point in the history
…b.com/melechlapson/qiskit into mlapson/switch-to-sphinx-ext-linkcode
  • Loading branch information
melechlapson committed Feb 21, 2024
2 parents cca9b04 + 1849ce1 commit 5bd18cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@
plot_html_show_formats = False


# Need this method for the sphinx.ext.linkcode extension
# ----------------------------------------------------------------------------------
# Source code links
# ----------------------------------------------------------------------------------
def linkcode_resolve(domain, info):
"""
Determine the URL corresponding to Python object
"""
if domain != "py":
return None

Expand Down Expand Up @@ -195,4 +194,6 @@ def linkcode_resolve(domain, info):
ending_lineno = lineno + len(source) - 1
linespec = f"#L{lineno}-L{ending_lineno}"

return f"https://github.com/Qiskit/qiskit_sphinx_theme/tree/{release}/{file_name}/{linespec}"
git_branch = "main"

return f"https://github.com/Qiskit/qiskit/tree/{git_branch}/{file_name}{linespec}"

0 comments on commit 5bd18cd

Please sign in to comment.