Skip to content

Commit

Permalink
update conf.py
Browse files Browse the repository at this point in the history
- replacing hardcoded 'stable' branch with the current working branch so docs point to current branch code
  • Loading branch information
taha-abdullah committed Mar 28, 2024
1 parent d2ff4cc commit 813be12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import sys
import os
import subprocess

# here i added the relative path because sphinx was not able
# to locate FastSurferCNN module directly for autosummary
Expand Down Expand Up @@ -215,5 +216,7 @@ def linkcode_resolve(domain, info):
anchor = "#:~:text=" + quote(anchor.split(".")[-1])
else:
anchor = ""
result = f"{gh_url}/blob/stable/{filename}.py{anchor}"
# Get the current branch name
current_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip().decode("utf-8")
result = f"{gh_url}/blob/{current_branch}/{filename}.py{anchor}"
return result

0 comments on commit 813be12

Please sign in to comment.