Skip to content

Commit 482d09f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6dab33e commit 482d09f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

doc/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"sphinx.ext.mathjax",
7070
"sphinx.ext.todo",
7171
"nbsphinx",
72-
'edit_on_github',
72+
"edit_on_github",
7373
]
7474

7575
exclude_patterns = [
@@ -149,8 +149,8 @@
149149
toggleprompt_offset_right = 35
150150

151151
# Configure the "Edit on GitHub links for Sphinx" extention
152-
edit_on_github_project = 'pandas-dev/pandas'
153-
edit_on_github_branch = 'main/doc/source'
152+
edit_on_github_project = "pandas-dev/pandas"
153+
edit_on_github_branch = "main/doc/source"
154154

155155
# Add any paths that contain templates here, relative to this directory.
156156
templates_path = ["../_templates"]

doc/sphinxext/edit_on_github.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@
88
import os
99
import warnings
1010

11-
12-
__licence__ = 'BSD (3 clause)'
11+
__licence__ = "BSD (3 clause)"
1312

1413

1514
def get_github_url(app, view, path):
16-
return 'https://github.com/{project}/{view}/{branch}/{path}'.format(
15+
return "https://github.com/{project}/{view}/{branch}/{path}".format(
1716
project=app.config.edit_on_github_project,
1817
view=view,
1918
branch=app.config.edit_on_github_branch,
20-
path=path)
19+
path=path,
20+
)
2121

2222

2323
def html_page_context(app, pagename, templatename, context, doctree):
24-
if templatename != 'page.html':
24+
if templatename != "page.html":
2525
return
2626

2727
if not app.config.edit_on_github_project:
2828
warnings.warn("edit_on_github_project not specified")
2929
return
3030

31-
path = os.path.relpath(doctree.get('source'), app.builder.srcdir)
32-
show_url = get_github_url(app, 'blob', path)
33-
edit_url = get_github_url(app, 'edit', path)
31+
path = os.path.relpath(doctree.get("source"), app.builder.srcdir)
32+
show_url = get_github_url(app, "blob", path)
33+
edit_url = get_github_url(app, "edit", path)
3434

35-
context['show_on_github_url'] = show_url
36-
context['edit_on_github_url'] = edit_url
35+
context["show_on_github_url"] = show_url
36+
context["edit_on_github_url"] = edit_url
3737

3838

3939
def setup(app):
40-
app.add_config_value('edit_on_github_project', '', True)
41-
app.add_config_value('edit_on_github_branch', 'master', True)
42-
app.connect('html-page-context', html_page_context)
40+
app.add_config_value("edit_on_github_project", "", True)
41+
app.add_config_value("edit_on_github_branch", "master", True)
42+
app.connect("html-page-context", html_page_context)

0 commit comments

Comments
 (0)