File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import argparse
4
4
from pathlib import Path
5
+ import shutil
5
6
6
7
from sphinx .application import Sphinx
7
8
@@ -22,6 +23,16 @@ def create_parser():
22
23
return parser .parse_args ()
23
24
24
25
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
+
25
36
if __name__ == "__main__" :
26
37
args = create_parser ()
27
38
@@ -52,3 +63,6 @@ def create_parser():
52
63
)
53
64
app .builder .copysource = False # Prevent unneeded source copying - we link direct to GitHub
54
65
app .build ()
66
+
67
+ if args .index_file :
68
+ create_index_file (build_directory )
You can’t perform that action at this time.
0 commit comments