]> rtime.felk.cvut.cz Git - rpp-test-sw.git/commitdiff
doc: Final version of `make upload`
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 Mar 2014 11:08:14 +0000 (12:08 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 Mar 2014 11:08:14 +0000 (12:08 +0100)
rpp-test-sw/commands/doc/Makefile

index 66b9dc43b6f67ee04aebb27f07a2ac0c4351121d..a93a5769695969a9e66ed38fda27c1c514d6c199 100644 (file)
@@ -19,7 +19,26 @@ clean:
 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: