diff options
| author | Charlotte Koch <dressupgeekout@gmail.com> | 2023-02-16 16:44:34 -0800 |
|---|---|---|
| committer | Charlotte Koch <dressupgeekout@gmail.com> | 2023-02-16 16:44:34 -0800 |
| commit | 758952605ea8cb1b7cf926076f591007d8d98b7e (patch) | |
| tree | 2ac581d31045011899a312efeb849f3540b3187a /mk | |
First commit
Diffstat (limited to 'mk')
| -rw-r--r-- | mk/willora.mk | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/mk/willora.mk b/mk/willora.mk new file mode 100644 index 0000000..b459c93 --- /dev/null +++ b/mk/willora.mk @@ -0,0 +1,57 @@ +# +# willora.mk +# Charlotte Koch <dressupgeekout@gmail.com> +# + +# XXX this should be generated w/ a configure-step? +WILLORABASE?= ${.CURDIR} + +NAME?= mybook +PDF_OUT?= ${NAME}.pdf +ADOC_TOTAL= ${NAME}.adoc + +BUNDLE?= bundle +THEME?= poppy +THEMEDIR?= ${WILLORABASE}/themes +FONTDIR?= ${WILLORABASE}/fonts +MEDIA?= prepress + +CUSTOM_PDF_CONVERTER= ${WILLORABASE}/lib/willora_pdf_converter.rb + +########## ########## ########## + +# XXX: Figure out why I can't do this: +# 'asciidoctor-pdf -a optimize' +# > GPL Ghostscript 9.50: Can't find initialization file gs_init.ps. +# https://docs.asciidoctor.org/pdf-converter/latest/optimize-pdf/ + +${PDF_OUT}: ${THEMEDIR}/${THEME}-theme.yml ${CUSTOM_PDF_CONVERTER} ${ADOC_TOTAL} Gemfile.lock + ${BUNDLE} exec sciidoctor-pdf \ + -v \ + -r ${CUSTOM_PDF_CONVERTER} \ + -d book \ + -o ${.TARGET} \ + -a pdf-fontsdir=${FONTDIR} \ + -a pdf-theme=${THEME} \ + -a pdf-themesdir=${THEMEDIR} \ + -a media=${MEDIA} \ + -a text-align=justify \ + ${ADOC_TOTAL} + +${ADOC_TOTAL}: ${CHAPTERS} + rm -f ${.TARGET} +.for chapter in ${CHAPTERS} + dos2unix < ${chapter} | sed -E \ + -e 's,[[:space:]]--[[:space:]],\&\#8212;,g' \ + -e 's,\é,\&\#233;,g' >> ${.TARGET} + printf '\n\n' >> ${.TARGET} +.endfor + +Gemfile.lock: + ${BUNDLE} install + +########## ########## ########## + +.PHONY: clean +clean: + rm -f ${PDF_OUT} ${ADOC_TOTAL} |
