From 7673876c45b7c9d2b9ddbd65747e09de52c1530e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 17 Nov 2023 13:38:15 -0800 Subject: [PATCH] enable edit-this-page button on RTD resolves #304 --- docs/customization.rst | 4 +--- sphinx_immaterial/nav_adapt.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/customization.rst b/docs/customization.rst index 9be42fbeb..91f931341 100644 --- a/docs/customization.rst +++ b/docs/customization.rst @@ -228,9 +228,7 @@ Configuration Options This is the url segment that is concatenated with :themeconf:`repo_url` to point readers to the document's source file. This is typically in the form of ``"blob//"``. - Defaults to a blank string (which disables the edit icon). This is disabled for builds on - ReadTheDocs as they implement their own mechanism based on the repository's branch or tagged - commit. + Defaults to a blank string (which disables the edit icon). .. themeconf:: features diff --git a/sphinx_immaterial/nav_adapt.py b/sphinx_immaterial/nav_adapt.py index 415cca72e..414c7a87c 100644 --- a/sphinx_immaterial/nav_adapt.py +++ b/sphinx_immaterial/nav_adapt.py @@ -845,7 +845,7 @@ def _html_page_context( } repo_url: Optional[str] = theme_options.get("repo_url") edit_uri: Optional[str] = theme_options.get("edit_uri") - if repo_url and edit_uri and not READTHEDOCS and "hide-edit-link" not in meta: + if repo_url and edit_uri and "hide-edit-link" not in meta: page["edit_url"] = "/".join( [ repo_url.rstrip("/"),