Skip to content

Commit

Permalink
Get extlinks path dynamically
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Nov 19, 2024
1 parent 4009f40 commit 5ff3ba6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# noqa: D100
from __future__ import annotations

import os

project = "FMF-Jinja"
author = "Cristian Le"
extensions = [
Expand Down Expand Up @@ -37,9 +39,12 @@
"https://jinja.palletsprojects.com/en/stable",
]
autodoc_member_order = "bysource"
# TODO: Make extlinks git reference aware

repo_slug = os.getenv("GITHUB_REPOSITORY", "LecrisUT/fmf-jinja")
git_ref = os.getenv("GITHUB_REF_NAME", "main")

extlinks = {
"issue": ("https://github.com/LecrisUT/fmf-jinja/issues/%s", "issue %s"),
"path": ("https://github.com/LecrisUT/fmf-jinja/tree/main/%s", "%s"),
"path": (f"https://github.com/{repo_slug}/tree/{git_ref}/%s", "%s"),
"user": ("https://github.com/%s", "%s"),
}

0 comments on commit 5ff3ba6

Please sign in to comment.