From d38ae6faad47480334bef34bde47dfa41c03a11f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 28 Aug 2016 14:23:37 +0200 Subject: Initial draft. --- lib/content.mk | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/content.mk (limited to 'lib') diff --git a/lib/content.mk b/lib/content.mk new file mode 100644 index 0000000..8157569 --- /dev/null +++ b/lib/content.mk @@ -0,0 +1,35 @@ +# Transform content into layout formats for Scribus + +# content +#texts = front chapter1 chapter2 chapter3 caption1 caption2 + +# filenames in specific format +docbookdraftfiles ?= $(addsuffix .xml,$(texts)) +markdowndraftfiles ?= $(addsuffix .mdn,$(texts)) +htmlfiles ?= $(addsuffix .html,$(texts)) + +# bundle targets +importfiles: $(htmlfiles) +draftfiles: $(markdowndraftfiles) + +# transformations into well-formed source +# * target extension slightly off to not auto-overwrite manual edits + +$(docbookdraftfiles): %.xml: %.doc Makefile + unoconv --format docbook $< + +$(markdowndraftfiles): %.mdn: %.xml Makefile + pandoc --from docbook --to markdown -o $@ $< + +# transformations from well-formed source to import-ready format + +$(htmlfiles): %.html: %.md Makefile + pandoc --from markdown --to html --standalone --smart -o $@ $< + +# housekeeping + +clean:: + rm -f $(docbookdraftfiles) $(markdowndraftfiles) + +.PHONY: draftfiles importfiles clean +.DELETE_ON_ERROR: -- cgit v1.2.3