Skip to content

Commit

Permalink
docs(python): Fix link to source code (#10542)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Aug 16, 2023
1 parent 485a549 commit 60573a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py-polars/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
web_root = "https://pola-rs.github.io"

# Specify version for version switcher dropdown menu
switcher_version_env = os.environ.get("POLARS_VERSION", "main")
version_match = re.fullmatch(r"py-(\d+\.\d+)\.\d+.*", switcher_version_env)
git_ref = os.environ.get("POLARS_VERSION", "main")
version_match = re.fullmatch(r"py-(\d+\.\d+)\.\d+.*", git_ref)
switcher_version = version_match.group(1) if version_match is not None else "dev"

html_theme_options = {
Expand Down Expand Up @@ -210,7 +210,7 @@ def linkcode_resolve(domain, info):
polars_root = (conf_dir_path.parent.parent / "polars").absolute()

fn = os.path.relpath(fn, start=polars_root)
return f"{github_root}/blob/main/py-polars/polars/{fn}{linespec}"
return f"{github_root}/blob/{git_ref}/py-polars/polars/{fn}{linespec}"


def _minify_classpaths(s: str) -> str:
Expand Down

0 comments on commit 60573a1

Please sign in to comment.