File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 66{% block breadcrumbs_aside %}
77 < li class ="source-link ">
88 {% if hasdoc(pagename) %}
9- {% if pagename.startswith("api/") or pagename.startswith("tutorials/") or pagename.startswith("examples/") %}
9+ {% if pagename.startswith(api_dir) %}
1010 {% set title = "Suggested improvement for " + pagename %}
1111 {% set body = "Please describe what could be improved about this page or the typo/mistake that you found:" %}
1212 < a href ="https://github.com/{{ github_repo }}/issues/new?title={{ title|urlencode }}&body={{ body|urlencode }} "
1313 class ="fa fa-github "> Improve this page</ a >
14+ {% elif pagename.split("/")[0] in galleries %}
15+ {% set gallery_path = gallery_dir[pagename.split("/")[0]] %}
16+ {% set example_script = pagename|replace(pagename.split("/")[0], gallery_dir[pagename.split("/")[0]]) %}
17+ {% if pagename.split("/")[-1] == "index" %}
18+ {% set example_script = example_script|replace("index", "README.txt") %}
19+ {% else %}
20+ {% set example_script = example_script + ".py" %}
21+ {% endif %}
22+ < a href ="https://github.com/{{ github_repo }}/edit/{{ github_version }}/{{ doc_path }}/{{ example_script }} "
23+ class ="fa fa-github "> Improve this page</ a >
1424 {% else %}
1525 < a href ="https://github.com/{{ github_repo }}/edit/{{ github_version }}/{{ doc_path }}/{{ pagename }}{{ suffix }} "
1626 class ="fa fa-github "> Improve this page</ a >
Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ def setup(app):
175175# links to the Github repository sources and issues
176176html_context = {
177177 'doc_path' : 'docs' ,
178+ 'galleries' : sphinx_gallery_conf ['gallery_dirs' ],
179+ 'gallery_dir' : dict (zip (sphinx_gallery_conf ['gallery_dirs' ],
180+ sphinx_gallery_conf ['examples_dirs' ])),
181+ 'api_dir' : 'api/generated' ,
178182 'github_repo' : 'Unidata/MetPy' ,
179183 'github_version' : 'master' , # Make changes to the master branch
180184}
You can’t perform that action at this time.
0 commit comments