doc.mw: docgen
(echo '<div class="toclimit-2" style="float: right; margin-left: 1em;">__TOC__</div>'; ./docgen wiki) | pandoc -f markdown_strict -t mediawiki > $@
-upload: doc.mw
+doc.mdwn: docgen Makefile
+# ./docgen wiki | pandoc -f markdown_strict -t markdown_strict > $@
+ ./docgen wiki > $@
+
+doc.html: docgen Makefile
+ ./docgen wiki | pandoc -f markdown_strict -t html --base-header-level=2 > $@
+
+upload: upload-mw upload-web
+
+upload-mw: doc.mw
cat $< | ./wiki-edit.pl TestCommands -
+WEB=../../../../web/
+WEBDST=$(WEB)test-sw-commands/rpp-test-sw.mdwn
+upload-web: doc.mdwn
+ifneq ($(wildcard $(WEBDST)),)
+ cp $< $(WEBDST)
+ make -C $(WEB)
+ git -C $(WEB) add $(WEBDST:$(WEB)%=%)
+ if ! git -C $(WEB) diff --cached --quiet; then git -C $(WEB) commit -m 'Automatic update of command reference' $(WEBDST:$(WEB)%=%) && git -C $(WEB) push; fi
+endif
+
FORCE: