From d38ae6faad47480334bef34bde47dfa41c03a11f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 28 Aug 2016 14:23:37 +0200 Subject: Initial draft. --- USE.md | 17 +++++++++++++++++ lib/content.mk | 35 +++++++++++++++++++++++++++++++++++ sample/.gitignore | 3 +++ sample/Makefile | 6 ++++++ 4 files changed, 61 insertions(+) create mode 100644 USE.md create mode 100644 lib/content.mk create mode 100644 sample/.gitignore create mode 100644 sample/Makefile diff --git a/USE.md b/USE.md new file mode 100644 index 0000000..30c9e22 --- /dev/null +++ b/USE.md @@ -0,0 +1,17 @@ +# Structured layout + +## Text content from external source + +Text content from external source - +e.g. Word document - +Cannot be trusted to contain well-structured styling. +Better to flatten and re-apply styling locally. + +1) Track external source in git +2) Transform external source to markdown + make draftfiles +3) Track local markdown source in git +4) Transform markdown source to html + make importfiles +5) Import html into Scribus +6) Adapt styles in Scribus (preserving style names) 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: diff --git a/sample/.gitignore b/sample/.gitignore new file mode 100644 index 0000000..9053879 --- /dev/null +++ b/sample/.gitignore @@ -0,0 +1,3 @@ +# ignore auto-generated intermediate and draft files +*.mdn +*.xml diff --git a/sample/Makefile b/sample/Makefile new file mode 100644 index 0000000..35f4be9 --- /dev/null +++ b/sample/Makefile @@ -0,0 +1,6 @@ +# Transform content into layout formats + +include /usr + +# content +texts = -- cgit v1.2.3