This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6b350900796 Fix links to source examples in Airflow docs (#50082)
6b350900796 is described below

commit 6b350900796f44ade8a339769b6c2d3142141cc5
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu May 1 17:45:29 2025 +0200

    Fix links to source examples in Airflow docs (#50082)
    
    While #49978 added back source links and it nicely works for
    the providers, there was still a problem with links to sources in
    Airflow - they were prefixed with extra `src`. This PR fixes it.
---
 devel-common/src/sphinx_exts/exampleinclude.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devel-common/src/sphinx_exts/exampleinclude.py 
b/devel-common/src/sphinx_exts/exampleinclude.py
index 3feaed367c3..2731f6522bf 100644
--- a/devel-common/src/sphinx_exts/exampleinclude.py
+++ b/devel-common/src/sphinx_exts/exampleinclude.py
@@ -195,6 +195,9 @@ def create_node(env, relative_path, show_button):
     if relative_path.startswith("airflow-core/src/"):
         relative_path = relative_path.replace("airflow-core/src/", "", 1)
 
+    if relative_path.startswith("src/"):
+        relative_path = relative_path.replace("src/", "", 1)
+
     if relative_path.endswith(".py"):
         pagename = "_modules/" + relative_path[:-3]
     else:

Reply via email to