Skip to content

Commit

Permalink
Add aliasing for sphinx.ext.linkcode
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Jan 7, 2025
1 parent 4114701 commit 3fea832
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@

# -- Options for sphinx.ext.linkcode ---------------------------------------------------

LINKCODE_ALIAS = {
"sdmx/testing": "sdmx/testing/__init__",
}


def linkcode_resolve(domain, info):
if domain != "py" or not info["module"]:
return None
filename = info["module"].replace(".", "/")
filename = LINKCODE_ALIAS.get(filename, filename)
return f"https://github.com/khaeru/sdmx/tree/main/{filename}.py"


Expand Down

0 comments on commit 3fea832

Please sign in to comment.