diff options
-rw-r--r-- | manual/Makefile | 10 | ||||
-rwxr-xr-x | manual/format-html | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/manual/Makefile b/manual/Makefile index 6b97f691..a2e5410b 100644 --- a/manual/Makefile +++ b/manual/Makefile @@ -11,15 +11,7 @@ obnam-manual.en.pdf: Makefile $(en_sources) ./format-pdf $@ "$(TITLE_EN)" "$(AUTHOR)" "$(VERSION)" $(en_sources) obnam-manual.en.html: Makefile $(en_sources) ../obnam.css - pandoc -H ../obnam.css --smart --toc --chapters --number-sections \ - --standalone \ - --self-contained \ - -V geometry:lettersize \ - -o $@ $(en_sources) - -en/000.mdwn: - (echo "% $(TITLE)"; echo "% $(AUTHOR)"; echo "% $(VERSION)") \ - > $@ + ./format-html $@ "$(TITLE_EN)" "$(AUTHOR)" "$(VERSION)" $(en_sources) clean: rm -f $(outputs) en/000.mdwn diff --git a/manual/format-html b/manual/format-html new file mode 100755 index 00000000..836ad990 --- /dev/null +++ b/manual/format-html @@ -0,0 +1,20 @@ +#!/bin/sh + +set -eu + +OUTPUT="$1" +TITLE="$2" +AUTHOR="$3" +VERSION="$4" +shift 4 + +cat > 000.mdwn <<EOF +% $TITLE +% $AUTHOR +% $VERSION +EOF + +pandoc -H ../obnam.css --smart --toc --chapters --number-sections \ + --standalone --self-contained -V geometry:lettersize \ + -o "$OUTPUT" 000.mdwn "$@" +rm -f 000.mdwn |