2022-05-20 19:52:45 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Add metadata to header
|
|
|
|
rm -f assembled.md
|
|
|
|
cat metadata.yaml north_pacific_logbook.md > assembled.md
|
|
|
|
|
|
|
|
# Build pdf
|
|
|
|
rm -f assembled.pdf
|
|
|
|
convert img/cover.jpg cover.pdf
|
2022-12-24 00:16:03 +01:00
|
|
|
pandoc --variable=geometry:a5paper north_pacific_logbook.md --pdf-engine=xelatex --from markdown+simple_tables+line_blocks --include-in-header=titlesec-conf.tex -o north_pacific_logbook.pdf
|
2022-05-20 19:52:45 +02:00
|
|
|
pdfunite cover.pdf north_pacific_logbook.pdf assembled.pdf
|
|
|
|
|
|
|
|
# Build epub
|
2022-12-24 00:16:03 +01:00
|
|
|
pandoc assembled.md --from markdown+simple_tables+line_blocks --toc -V toc-title:"Table of Contents" --toc-depth=1 --epub-metadata=metadata.yaml --epub-cover-image=img/cover.jpg --css epub.css -w epub -o assembled.epub
|
2022-05-20 19:52:45 +02:00
|
|
|
|
|
|
|
# Build mobi
|
|
|
|
ebook-convert "assembled.epub" "assembled.mobi"
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -f busy-doing-nothing.pdf
|
|
|
|
rm -f busy-doing-nothing.epub
|
|
|
|
rm -f busy-doing-nothing.mobi
|
|
|
|
rm -f assembled.md
|
|
|
|
rm -f cover.pdf
|
|
|
|
|
|
|
|
mv assembled.pdf busy-doing-nothing.pdf
|
|
|
|
mv assembled.epub busy-doing-nothing.epub
|
|
|
|
mv assembled.mobi busy-doing-nothing.mobi
|
|
|
|
|
2022-12-24 00:16:03 +01:00
|
|
|
butler push busy-doing-nothing.pdf hundredrabbits/busy-doing-nothing:pdf
|
|
|
|
butler push busy-doing-nothing.epub hundredrabbits/busy-doing-nothing:epub
|
|
|
|
butler push busy-doing-nothing.mobi hundredrabbits/busy-doing-nothing:mobi
|