Skip to content

Commit 0156b09

Browse files
committed
DOC: added exclude_edit_page_button and logic for it to work
1 parent f82cb3d commit 0156b09

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/_templates/edit-this-page.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{# Displays a link to the edit interface of the page source in the specified Version Control System. #}
2+
{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix and pagename not in exclude_edit_page_button %}
3+
{% set src = sourcename.split('.') %}
4+
<div class="tocsection editthispage">
5+
<a href="{{ get_edit_provider_and_url()[1] }}">
6+
<i class="fa-solid fa-pencil"></i>
7+
{% set provider = get_edit_provider_and_url()[0] %}
8+
{% block edit_this_page_text %}
9+
{% if provider %}
10+
{% trans provider=provider %}Edit on {{ provider }}{% endtrans %}
11+
{% else %}
12+
{% trans %}Edit{% endtrans %}
13+
{% endif %}
14+
{% endblock %}
15+
</a>
16+
</div>
17+
{% endif %}

doc/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@
399399
"github_repo": "pandas",
400400
"github_version": "main",
401401
"doc_path": "doc/source",
402+
"exclude_edit_page_button": ["index"],
402403
}
403404

404405
# If false, no module index is generated.

0 commit comments

Comments
 (0)