Skip to content

Commit 489b98b

Browse files
committed
simplify build, restoring rendered page features (buttons, section navigation)
1 parent 65a9a68 commit 489b98b

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

scripts/execute-convert.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,23 @@ def run_command(command, verbose=1):
1717
print(f"Output: {result.stdout}")
1818
return result
1919

20-
21-
book = False
2220
notebooks = glob.glob("*.ipynb")
2321
if len(notebooks) > 1:
2422
print("More than one .ipynb notebook found --> assuming this is a book")
25-
book = True
2623

27-
if book is True:
2824
# build book
2925
command = ["jb", "build", ".", "--config", "_config.yml", "--toc", "_toc.yml"]
3026
run_command(command)
31-
# build pdf
32-
command = [
33-
"jb",
34-
"build",
35-
".",
36-
"--config",
37-
"_config.yml",
38-
"--toc",
39-
"_toc.yml",
40-
"--builder",
41-
"pdfhtml",
42-
]
43-
run_command(command)
4427

4528
# copy build outputs to 'html' dir
4629
command = ["cp", "-r", "_build/html", "html"]
4730
run_command(command)
48-
command = ["cp", "_build/pdf/book.pdf", "html"]
49-
run_command(command)
50-
31+
5132
else:
5233
# build single notebook
5334
command = ["jb", "build", f"{slug}.ipynb", "--config", "_config.yml"]
5435
run_command(command)
55-
# build pdf
56-
command = [
57-
"jb",
58-
"build",
59-
f"{slug}.ipynb",
60-
"--config",
61-
"_config.yml",
62-
"--builder",
63-
"pdfhtml",
64-
]
65-
run_command(command)
6636

6737
# copy build outputs to 'html' dir
6838
command = ["cp", "-r", f"_build/_page/{slug}/html", "html"]
6939
run_command(command)
70-
command = ["cp", f"_build/_page/{slug}/pdf/{slug}.pdf", "html"]
71-
run_command(command)

0 commit comments

Comments
 (0)