Skip to content

Commit a03f795

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0e9d991 commit a03f795

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

doc/sphinxext/show_edit_this_page.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
"""Sphinx extension for checking if Edit this Page button should show on this page."""
22

3+
34
def html_page_context(app, pagename, templatename, context, doctree):
45
if (
5-
any(part in context['exclude_edit_this_page_directory'] for part in pagename.split("/")) or
6-
pagename in context['exclude_edit_this_page_pagename']
6+
any(
7+
part in context["exclude_edit_this_page_directory"]
8+
for part in pagename.split("/")
9+
)
10+
or pagename in context["exclude_edit_this_page_pagename"]
711
):
8-
context['show_edit_this_page'] = False
12+
context["show_edit_this_page"] = False
913
else:
10-
context['show_edit_this_page'] = True
11-
12-
14+
context["show_edit_this_page"] = True
15+
16+
1317
def setup(app):
14-
app.connect('html-page-context', html_page_context)
15-
return {"parallel_read_safe": True}
18+
app.connect("html-page-context", html_page_context)
19+
return {"parallel_read_safe": True}

0 commit comments

Comments
 (0)