@@ -97,6 +97,21 @@ function downloadLibs() {
9797 reveal.js-plugins-master reveal.js-plugins
9898}
9999
100+ function downloadTemplates() {
101+
102+ local TEMPLATES_FOLDER=" ../templates"
103+
104+ if [ -e " $TEMPLATES_FOLDER " ]; then
105+ if [ ! -d " $TEMPLATES_FOLDER " ]; then
106+ error " ERROR: $TEMPLATES_FOLDER exists and is not a folder"
107+ exit -1
108+ fi
109+ else
110+ mkdir " $TEMPLATES_FOLDER "
111+ cp $ORIGIN /templates/* " $TEMPLATES_FOLDER "
112+ fi
113+ }
114+
100115function initExportFolder() {
101116
102117 local FOLDER_NAME=" $1 "
@@ -306,7 +321,7 @@ function buildRevealSlides() {
306321 REVEAL_JS_SHOW_CHALKBOARD_MD=" "
307322 fi
308323
309- pandoc -w revealjs --template " $ORIGIN /templates/reveal-slides-template.html" \
324+ pandoc -w revealjs --template " .. /templates/reveal-slides-template.html" \
310325 --variable " revealjs-title-footer=$REVEAL_JS_TITLE_FOOTER " \
311326 --variable " revealjs-show-menu=$REVEAL_JS_SHOW_MENU_MD " \
312327 --variable " revealjs-show-chalkboard=$REVEAL_JS_SHOW_CHALKBOARD_MD " \
@@ -377,7 +392,7 @@ function buildHtmlBook() {
377392
378393 info " Exporting... ../export/$NAME -book$PLUS .html"
379394
380- pandoc -w html5 --template " $ORIGIN /templates/html-book-template.html" \
395+ pandoc -w html5 --template " .. /templates/html-book-template.html" \
381396 --table-of-contents --top-level-division=chapter --highlight-style=tango \
382397 " $NUMBERS " --mathjax -o " ../export/$NAME -book$PLUS .html" " ../export/$NAME -book$PLUS .md"
383398
@@ -632,6 +647,8 @@ function processFolder() {
632647 info " ==============================="
633648 info " Processing folder... ../$FOLDER "
634649
650+ downloadTemplates
651+
635652 if [ -e " $FOLDER /build.properties" ]; then
636653 info " Overwriting properties... ../build.properties"
637654 # shellcheck source=/dev/null
0 commit comments