1 parent 65ba713 commit 9f6fc28Copy full SHA for 9f6fc28
1 file changed
wrapper.sh
@@ -14,6 +14,13 @@ python3 generate-summary.py
14
# if arg is "build", just build the book
15
if [ "$1" = "build" ]; then
16
mdbook build
17
+
18
+ # wipe off the .html extension
19
+ perl -i -p -e 's{href="index.html"}{href="."}g' book/toc.js
20
+ perl -i -p -e 's{(href="[a-zA-Z0-9.][^"]+)\.html"}{$1"}g' book/toc.js
21
+ find book/ -name *.html | xargs perl -i -p -e 's{href="index.html"}{href="."}g'
22
+ find book/ -name *.html | xargs perl -i -p -e 's{(href="[a-zA-Z0-9.][^"]+)\.html"}{$1"}g'
23
24
else
25
mdbook serve --hostname '0.0.0.0'
26
fi
0 commit comments