From dfe828b0229e7a1bd6c5e48bf198fd1cbeeaa3d8 Mon Sep 17 00:00:00 2001 From: Matt Sephton Date: Wed, 8 Dec 2021 11:53:02 +0000 Subject: [PATCH] generate epub2 format output --- scripts/build.sh | 1 + templates/custom.epub2 | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 templates/custom.epub2 diff --git a/scripts/build.sh b/scripts/build.sh index 92c7589..bd5058c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -97,6 +97,7 @@ pandoc -f markdown --template=../templates/custom $TEMP \ --toc --toc-depth=1 \ --listings \ --include-before-body=../content/intro.txt \ + --to=epub2 \ -o $OUTPUTEPUB ## End of file diff --git a/templates/custom.epub2 b/templates/custom.epub2 new file mode 100644 index 0000000..4f97df9 --- /dev/null +++ b/templates/custom.epub2 @@ -0,0 +1,51 @@ + + + + + + + + $pagetitle$ +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ + + +$if(titlepage)$ +$for(title)$ +$if(title.text)$ +

$title.text$

+$else$ +

$title$

+$endif$ +$endfor$ +$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$for(creator)$ +

$creator.text$

+$endfor$ +$if(publisher)$ +

$publisher$

+$endif$ +$if(date)$ +

$date$

+$endif$ +$if(rights)$ +

$rights$

+$endif$ +$else$ +$body$ +$endif$ + + \ No newline at end of file