8000 Add/update build and run · python/peps@85ae140 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85ae140

Browse files
committed
Add/update build and run
1 parent c8268fb commit 85ae140

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
from pathlib import Path
5+
import shutil
56

67
from sphinx.application import Sphinx
78

@@ -22,6 +23,16 @@ def create_parser():
2223
return parser.parse_args()
2324

2425

26+
def create_index_file(html_content: Path):
27+
pep_zero_html = html_content / "pep-0000.html"
28+
pep_zero_dir = html_content / "pep-0000" / "index.html"
29+
30+
if pep_zero_html.is_file():
31+
shutil.copy(pep_zero_html, html_content / "index.html")
32+
elif pep_zero_dir.is_file():
33+
shutil.copy(pep_zero_dir, html_content / "index.html")
34+
35+
2536
if __name__ == "__main__":
2637
args = create_parser()
2738

@@ -52,3 +63,6 @@ def create_parser():
5263
)
5364
app.builder.copysource = False # Prevent unneeded source copying - we link direct to GitHub
5465
app.build()
66+
67+
if args.index_file:
68+
create_index_file(build_directory)

0 commit comments

Comments
 (0)
0