chiark / gitweb /
publish html
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 27 Oct 2021 11:37:03 +0000 (12:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 27 Oct 2021 11:37:03 +0000 (12:37 +0100)
.gitignore
Makefile

index 8efe0f5913ae2e640dddf78f7f2c2d72a49c8aaf..2dc9fcbe71474c73f3f6c5cea8d1f073828b3920 100644 (file)
@@ -3,3 +3,5 @@ pumpkin-books.pdf
 bag.pgm
 pot.pgm
 *.tmp.*
+*.md.txt
+*.md.html
index fd42c30b97162f59f76f58508f9050bdbeceec70..17465b0c384415d407c3f22b9e8473425223422a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,12 @@
 
-PUBLISH= pumpkin-books.pdf pumpkin-books.md house-rules.md
+PUBLISH_MD += pumpkin-books house-rules
+PUBLISH += pumpkin-books.pdf 
+PUBLISH += $(addsuffix .md.txt,  $(PUBLISH_MD))
+PUBLISH += $(addsuffix .md.html, $(PUBLISH_MD))
 
 SHELL=bash
 
-all:   pumpkin-books.pdf
+all:   $(PUBLISH)
 
 # Don't print the ps, printers (eg ours!) don't always have the fonts
 
@@ -41,6 +44,16 @@ droplet.ppm: droplet.svg Makefile
        | pnmdepth 255                                  \
        | $(make_pnm)
 
+PUBLISH_FILES= \
+       $(patsubst %.md,%.md.txt, $(PUBLISH)) \
+       $(patsubst %.md,%.md.html, $(filter $(PUBLISH)) \
+
+%.md.txt: %.md
+       cat $< $o
+
+%.md.html: %.md Makefile
+       pandoc -s $< $o
+
 pubssh=c
 pubpath=games-rules/quacks
 puburl=https://www.chiark.greenend.org.uk/~ijackson/