File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change
1
+ {#
2
+
3
+ Modify the "Edit on Github" links to handle auto-generated pages in the
4
+ example gallery and the API reference listings. The GH links that sphinx
5
+ generates by default make the assumption that an HTML file comes from an RST
6
+ file with the same filepath, which isn't the case for autogenerated files. The
7
+ logic to generate the correct URL is in conf.py, but we still have to modify
8
+ the template here to change the "Edit this page" text to "View on GitHub".
9
+
10
+ #}
11
+
12
+ {% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %}
13
+ {% set src = sourcename.split('.') %}
14
+ < div class ="tocsection editthispage ">
15
+ < a href ="{{ make_github_url(sourcename) }} ">
16
+ < i class ="fab fa-github-square "> </ i > {{ _("View on GitHub") }}
17
+ </ a >
18
+ </ div >
19
+ {% endif %}
Original file line number Diff line number Diff line change @@ -480,11 +480,11 @@ def make_github_url(file_name):
480
480
# variables to pass into the HTML templating engine; these are accessible from
481
481
# _templates/breadcrumbs.html
482
482
html_context = {
483
- # 'make_github_url': make_github_url,
484
- # 'edit_page_url_template': '{{ make_github_url(file_name) }}',
483
+ 'make_github_url' : make_github_url ,
484
+ 'edit_page_url_template' : '{{ make_github_url(file_name) }}' ,
485
485
"github_url" : "https://github.com" ,
486
486
"github_user" : "pvlib" ,
487
487
"github_repo" : "pvlib-python" ,
488
488
"github_version" : "main" ,
489
- "doc_path" : "docs/sphinx" ,
489
+ "doc_path" : "docs/sphinx/source/ " ,
490
490
}
You can’t perform that action at this time.
0 commit comments