From 13312dad9a3d0426256aaf33eff9439d368e0b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 30 Oct 2026 12:04:36 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20link=20pages=20back=20to?= =?UTF-8?q?=20the=20repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set Furo's source_repository so each page gets view and edit buttons pointing at GitHub, and add a GitHub footer icon. Closes #174 --- docs/_static/github.svg | 1 + docs/changelog/174.doc.rst | 1 + docs/conf.py | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 docs/_static/github.svg create mode 100644 docs/changelog/174.doc.rst diff --git a/docs/_static/github.svg b/docs/_static/github.svg new file mode 100644 index 0000000..cc2be72 --- /dev/null +++ b/docs/_static/github.svg @@ -0,0 +1 @@ + diff --git a/docs/changelog/174.doc.rst b/docs/changelog/174.doc.rst new file mode 100644 index 0000000..4b9a458 --- /dev/null +++ b/docs/changelog/174.doc.rst @@ -0,0 +1 @@ +Link every documentation page to its source and edit view on GitHub, and add a GitHub icon to the footer. diff --git a/docs/conf.py b/docs/conf.py index 04effbe..8cb145b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,6 +10,7 @@ company = "tox-dev" name = "python-discovery" +repository = f"https://github.com/{company}/{name}" version = ".".join(__version__.split(".")[:2]) release = __version__ copyright = f"2026-{datetime.now(tz=timezone.utc).year}, {company}" # ruff:ignore[builtin-variable-shadowing] @@ -31,9 +32,9 @@ autosectionlabel_maxdepth = 2 extlinks = { - "issue": ("https://github.com/tox-dev/python-discovery/issues/%s", "#%s"), - "pr": ("https://github.com/tox-dev/python-discovery/pull/%s", "PR #%s"), - "pull": ("https://github.com/tox-dev/python-discovery/pull/%s", "PR #%s"), + "issue": (f"{repository}/issues/%s", "#%s"), + "pr": (f"{repository}/pull/%s", "PR #%s"), + "pull": (f"{repository}/pull/%s", "PR #%s"), "user": ("https://github.com/%s", "@%s"), } @@ -60,6 +61,18 @@ "light_logo": "logo.svg", "dark_logo": "logo.svg", "sidebar_hide_name": True, + "source_repository": repository, + "source_branch": "main", + "source_directory": "docs/", + "footer_icons": [ + { + "name": "GitHub", + "url": repository, + # footer icons are inlined into every page, so a path to the image would not resolve + "html": (Path(__file__).parent / "_static" / "github.svg").read_text(encoding="utf-8"), + "class": "", + }, + ], } html_css_files = ["custom.css"]