diff Makefile.doc @ 31:3b0546fa0d74

Add documentation in alternative formats to HTML.
author David Barts <davidb@stashtea.com>
date Sat, 18 Apr 2020 09:08:23 -0700
parents
children 3d86f0391168
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.doc	Sat Apr 18 09:08:23 2020 -0700
@@ -0,0 +1,21 @@
+.PHONY: clean
+
+all: Readme.rst Readme.pdf
+
+clean:
+	-rm *.rst *.pdf *.ps *.nrf
+
+%.rst : %.html
+	echo "[This file automatically generated by pandoc from '$<'.]" > $@
+	echo "" >> $@
+	pandoc --from=html --to=rst $< >> $@
+
+%.nrf : %.html
+	echo ".so custom.tmac" > $@
+	pandoc --from=html --to=ms $< | sed -e 's/^\.LP/.PP/' >> $@
+
+%.ps: %.nrf custom.tmac
+	groff -Tps -t -ms -mpdfmark $< > $@
+
+%.pdf : %.ps
+	ps2pdf $<