diff options
| author | Charlotte Koch <charlotte@magentastripe.com> | 2023-12-31 14:58:26 -0800 |
|---|---|---|
| committer | Charlotte Koch <charlotte@magentastripe.com> | 2023-12-31 14:58:26 -0800 |
| commit | ff5eaede74d81e978584ba9c732fc27346c773de (patch) | |
| tree | bbb67c9799de8f491703918cbc1cdb706c0ca3f5 | |
| parent | d4db291d6f021ed788b3142ba5f5ddd565bcff6c (diff) | |
Put docx fixups into a separate file
| -rw-r--r-- | mk/willora.mk | 5 | ||||
| -rw-r--r-- | script/docx_fixup.sed | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mk/willora.mk b/mk/willora.mk index f79e6fb..99a3ebd 100644 --- a/mk/willora.mk +++ b/mk/willora.mk @@ -46,6 +46,7 @@ BIOGRAPHY_OUT?= biography.pdf CUSTOM_PDF_CONVERTER= ${WILLORABASE}/lib/${THEME}_pdf_converter.rb ERBBER_SCRIPT= script/erbber.rb UNICODE_TABLE= script/unicodify.sed +DOCX_FIXUP= script/docx_fixup.sed VOLUMEKIND_PAPERBACK= PAPERBACK VOLUMEKIND_HARDCOVER= HARDCOVER @@ -264,8 +265,8 @@ ${DOCBOOK_ADOC_TOTAL}: ${CHAPTERS} ${UNICODE_TABLE} # in the conversion to docx. So we have to make them look the way we want # ("# # #") right now. CLEANFILES+= ${DOCX_OUT} -${DOCX_OUT}: ${DOCBOOK_OUT} - sed -E -e 's,<\?asciidoc-hr\?>,\&\#35; \&\#35; \&\#35;,' ${DOCBOOK_OUT} | \ +${DOCX_OUT}: ${DOCBOOK_OUT} ${DOCX_FIXUP} + sed -E -f ${DOCX_FIXUP} ${DOCBOOK_OUT} | \ ${PANDOC} --from docbook --to docx \ -o ${.TARGET} \ - diff --git a/script/docx_fixup.sed b/script/docx_fixup.sed new file mode 100644 index 0000000..566a76e --- /dev/null +++ b/script/docx_fixup.sed @@ -0,0 +1,6 @@ +# Render a thematic break as 3 hash symbols. +s,<\?asciidoc-hr\?>,\&\#35; \&\#35; \&\#35;, + +# Asciidoctor puts a zero-width space after ellipses for some reason -- get +# rid of it. +s,\&\#8203;,,g |
