Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All PEPs: Move to peps/ folder #3418

Merged
merged 22 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Source link is always .rst
  • Loading branch information
AA-Turner committed Sep 3, 2023
commit 0099c2998eb70f07bd89bea713c723c2929dba05
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
from pathlib import Path

from docutils import nodes
from docutils.frontend import OptionParser
from sphinx.builders.html import StandaloneHTMLBuilder
Expand Down Expand Up @@ -31,10 29,6 @@
except KeyError:
title = ""

# source filename
file_is_rst = Path(self.env.srcdir, docname ".rst").exists()
source_name = f"{docname}.rst" if file_is_rst else f"{docname}.txt"

# local table of contents
toc_tree = self.env.tocs[docname].deepcopy()
if len(toc_tree) and len(toc_tree[0]) > 1:
Expand All @@ -46,8 40,8 @@
else:
toc = "" # PEPs with no sections -- 9, 210

return {"title": title, "sourcename": source_name, "toc": toc, "body": body}
return {"title": title, "toc": toc, "body": body}

Check warning on line 44 in pep_sphinx_extensions/pep_processor/html/pep_html_builder.py

View check run for this annotation

Codecov / codecov/patch

pep_sphinx_extensions/pep_processor/html/pep_html_builder.py#L43-L44

Added lines #L43 - L44 were not covered by tests

class DirectoryBuilder(FileBuilder):
# sync all overwritten things from DirectoryHTMLBuilder
Expand Down
4 changes: 2 additions & 2 deletions pep_sphinx_extensions/pep_theme/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 43,8 @@ <h1>Python Enhancement Proposals</h1>
<h2>Contents</h2>
{{ toc }}
<br>
{%- if not sourcename.startswith(("pep-0000", "topic")) %}
<a id="source" href="https://github.com/python/peps/blob/main/{{sourcename}}">Page Source (GitHub)</a>
{%- if not pagename.startswith(("pep-0000", "topic")) %}
<a id="source" href="https://github.com/python/peps/blob/main/peps/{{pagename}}.rst">Page Source (GitHub)</a>
{%- endif %}
</nav>
</section>
Expand Down
Loading