From e5942642e1513e57990f258548deb1b1c2796e95 Mon Sep 17 00:00:00 2001 From: Fredrik Unger Date: Wed, 31 Jul 2013 10:54:26 +0200 Subject: [PATCH] base: Makefiles and default files added Two Makefiles that recursively scans and build each tag subdirectory with the availible style sheets. Default style sheets to simplify adding the external Docbook stylesheet from the tag subdirectories. --- Makefile | 19 +++++++++++++++++++ Makefile.tag | 46 ++++++++++++++++++++++++++++++++++++++++++++++ default.html.xsl | 8 ++++++++ default.pdf.xsl | 8 ++++++++ 4 files changed, 81 insertions(+) create mode 100644 Makefile create mode 100644 Makefile.tag create mode 100644 default.html.xsl create mode 100644 default.pdf.xsl diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0f658bf --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +### Makefile --- + +## Author: Fredrik Unger + +TAGS=$(shell find . -type d -regex './[a-z]+') +clean_TAGS=$(addprefix clean_,$(TAGS)) + +all: $(TAGS) +clean: $(clean_TAGS) + +.PHONY: $(TAGS) $(clean_TAGS) + +$(TAGS): + make -f ../Makefile.tag -C $@ + +$(clean_TAGS): + make -f ../Makefile.tag -C $(patsubst clean_%,%,$@) clean + +### Makefile ends here diff --git a/Makefile.tag b/Makefile.tag new file mode 100644 index 0000000..4dbeb78 --- /dev/null +++ b/Makefile.tag @@ -0,0 +1,46 @@ +### Makefile --- + +## Author: Fredrik Unger + +EXAMPLE_HTML=$(shell find . -type f -name '*.html.xsl') +HTML_FILES=$(patsubst %.html.xsl, %.html, $(EXAMPLE_HTML)) +HTML_PNG_FILES=$(patsubst %.html.xsl, %.html.png, $(EXAMPLE_HTML)) + +EXAMPLE_PDF=$(shell find . -type f -name '*.pdf.xsl') +PDF_FILES=$(patsubst %.pdf.xsl, %.pdf, $(EXAMPLE_PDF)) +PDF_PNG_FILES=$(patsubst %.pdf.xsl, %.pdf.png, $(EXAMPLE_PDF)) + +DEFAULT_FILES=default.html default.html.png default.pdf default.pdf.png + +all: $(HTML_FILES) $(HTML_PNG_FILES) $(PDF_FILES) $(PDF_PNG_FILES) $(DEFAULT_FILES) + +%.html.png: %.html + python -m SimpleHTTPServer 8000 & echo "$$!" > server.pid + sleep 1 + cutycapt --url=http://localhost:8000/"$<" --out="$@" + kill `cat server.pid` + rm server.pid + +%.pdf.png: %.pdf + convert "$<" "$@" + +default.html: ../default.html.xsl example.xml + xsltproc --xinclude --output "$@" "$<" example.xml + +default.pdf: ../default.pdf.xsl example.xml + xsltproc --xinclude --output ex.fo "$<" example.xml + fop ex.fo "$@" + rm ex.fo + +%.html: %.html.xsl example.xml + xsltproc --xinclude --output "$@" "$<" example.xml + +%.pdf: %.pdf.xsl example.xml + xsltproc --xinclude --output ex.fo "$<" example.xml + fop ex.fo "$@" + rm ex.fo + +clean: + rm -f *~ server.pid ex.fo $(HTML_FILES) $(HTML_PNG_FILES) $(PDF_FILES) $(PDF_PNG_FILES) $(DEFAULT_FILES) + +### Makefile ends here diff --git a/default.html.xsl b/default.html.xsl new file mode 100644 index 0000000..8feb2a8 --- /dev/null +++ b/default.html.xsl @@ -0,0 +1,8 @@ + + + + + + diff --git a/default.pdf.xsl b/default.pdf.xsl new file mode 100644 index 0000000..ff489ed --- /dev/null +++ b/default.pdf.xsl @@ -0,0 +1,8 @@ + + + + + + -- 2.30.2