summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlotte Koch <dressupgeekout@gmail.com>2023-02-27 22:26:55 -0800
committerCharlotte Koch <dressupgeekout@gmail.com>2023-02-27 22:26:55 -0800
commitee73c4b63c38226191da1605324d76b223cee3e2 (patch)
treefa81e8776e2b6ce2af87ba211502af9b2c85c4c2
parent6d7f1d86929a87b4217a8d771635e58c990f26af (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.
-rw-r--r--mk/willora.mk37
-rw-r--r--themes/poppy-colophon-theme.yml9
-rw-r--r--themes/poppy-dedication-theme.yml13
3 files changed, 57 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,\&iuml;,\&\#239;,g' \
-e 's,\&eacute;,\&\#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}
diff --git a/themes/poppy-colophon-theme.yml b/themes/poppy-colophon-theme.yml
new file mode 100644
index 0000000..6e42e4b
--- /dev/null
+++ b/themes/poppy-colophon-theme.yml
@@ -0,0 +1,9 @@
+---
+
+extends: poppy
+
+base:
+ line-height: 1.0
+
+prose:
+ text-indent-inner: 0
diff --git a/themes/poppy-dedication-theme.yml b/themes/poppy-dedication-theme.yml
new file mode 100644
index 0000000..351b9e1
--- /dev/null
+++ b/themes/poppy-dedication-theme.yml
@@ -0,0 +1,13 @@
+---
+
+extends: poppy
+
+page:
+ margin: [2.5in, ~, ~, ~]
+
+base:
+ line-height: 1.0
+ text-align: center
+
+prose:
+ text-indent-inner: 0