From 2f94288d00a438c1ffdfa2683eed0274f0953a50 Mon Sep 17 00:00:00 2001 From: melechlapson Date: Wed, 21 Feb 2024 14:48:35 -0600 Subject: [PATCH 1/3] Add section header for source code links Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 3c7281a2dd7b..6be32d1e7a4b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -159,7 +159,9 @@ 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 From 1d5c34d0c9a55b12f91043c33e224d6a6c0037d5 Mon Sep 17 00:00:00 2001 From: melechlapson Date: Wed, 21 Feb 2024 14:49:31 -0600 Subject: [PATCH 2/3] removed docstring Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- docs/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6be32d1e7a4b..febaec276e52 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -163,9 +163,6 @@ # Source code links # ---------------------------------------------------------------------------------- def linkcode_resolve(domain, info): - """ - Determine the URL corresponding to Python object - """ if domain != "py": return None From 1849ce199fe8dc6e829674ea1c8f5d94a92139bd Mon Sep 17 00:00:00 2001 From: melechlapson Date: Wed, 21 Feb 2024 14:50:36 -0600 Subject: [PATCH 3/3] update return string Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index febaec276e52..b262b8d32a16 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -193,4 +193,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}"