diff options
| author | Charlotte Koch <dressupgeekout@gmail.com> | 2023-02-27 22:26:55 -0800 |
|---|---|---|
| committer | Charlotte Koch <dressupgeekout@gmail.com> | 2023-02-27 22:26:55 -0800 |
| commit | ee73c4b63c38226191da1605324d76b223cee3e2 (patch) | |
| tree | fa81e8776e2b6ce2af87ba211502af9b2c85c4c2 /mk | |
| parent | 6d7f1d86929a87b4217a8d771635e58c990f26af (diff) | |
Allow Colophon and Dedication page to have unique styles
The unique styling for the Colophon and Dedication pages (and probably some
others in the future, too) is taken care of with the "imported PDF" feature
of Asciidoctor-PDF.
Diffstat (limited to 'mk')
| -rw-r--r-- | mk/willora.mk | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/mk/willora.mk b/mk/willora.mk index 780ce43..b89b1cc 100644 --- a/mk/willora.mk +++ b/mk/willora.mk @@ -16,6 +16,9 @@ THEMEDIR?= ${WILLORABASE}/themes FONTDIR?= ${WILLORABASE}/fonts MEDIA?= prepress +COLOPHON_OUT?= colophon.pdf +DEDICATION_OUT?= dedication.pdf + CUSTOM_PDF_CONVERTER= ${WILLORABASE}/lib/willora_pdf_converter.rb ########## ########## ########## @@ -25,7 +28,8 @@ CUSTOM_PDF_CONVERTER= ${WILLORABASE}/lib/willora_pdf_converter.rb # > 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 +CLEANFILES+= ${PDF_OUT} +${PDF_OUT}: ${THEMEDIR}/${THEME}-theme.yml ${CUSTOM_PDF_CONVERTER} ${ADOC_TOTAL} Gemfile.lock ${COLOPHON_OUT} ${DEDICATION_OUT} ${BUNDLE} exec asciidoctor-pdf \ -v \ -r ${CUSTOM_PDF_CONVERTER} \ @@ -38,15 +42,44 @@ ${PDF_OUT}: ${THEMEDIR}/${THEME}-theme.yml ${CUSTOM_PDF_CONVERTER} ${ADOC_TOTAL} -a text-align=justify \ ${ADOC_TOTAL} +CLEANFILES+= ${ADOC_TOTAL} ${ADOC_TOTAL}: ${CHAPTERS} rm -f ${.TARGET} .for chapter in ${CHAPTERS} dos2unix < ${chapter} | sed -E \ -e 's,[[:space:]]--[[:space:]],\&\#8212;,g' \ + -e 's,\ï,\&\#239;,g' \ -e 's,\é,\&\#233;,g' >> ${.TARGET} printf '\n\n' >> ${.TARGET} .endfor +CLEANFILES+= ${COLOPHON_OUT} +${COLOPHON_OUT}: ${THEMEDIR}/${THEME}-colophon-theme.yml ${COLOPHON_FILE} ${CUSTOM_PDF_CONVERTER} Gemfile.lock + ${BUNDLE} exec asciidoctor-pdf \ + -v \ + -r ${CUSTOM_PDF_CONVERTER} \ + -d book \ + -o ${.TARGET} \ + -a pdf-fontsdir=${FONTDIR} \ + -a pdf-theme=${THEME}-colophon \ + -a pdf-themesdir=${THEMEDIR} \ + -a media=print \ + -a text-align=justify \ + ${COLOPHON_FILE} + +CLEANFILES+= ${DEDICATION_OUT} +${DEDICATION_OUT}: ${THEMEDIR}/${THEME}-dedication-theme.yml ${DEDICATION_FILE} ${CUSTOM_PDF_CONVERTER} Gemfile.lock + ${BUNDLE} exec asciidoctor-pdf \ + -v \ + -r ${CUSTOM_PDF_CONVERTER} \ + -d book \ + -o ${.TARGET} \ + -a pdf-fontsdir=${FONTDIR} \ + -a pdf-theme=${THEME}-dedication \ + -a pdf-themesdir=${THEMEDIR} \ + -a media=print \ + ${DEDICATION_FILE} + Gemfile.lock: ${BUNDLE} install @@ -54,4 +87,4 @@ Gemfile.lock: .PHONY: clean clean: - rm -f ${PDF_OUT} ${ADOC_TOTAL} + rm -f ${CLEANFILES} |
