Add index.markdown->HTML to the various macros.
[mkws-moved-to-github.git] / doc / Makefile
1 # Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
2
3 DOCS = index.html index.odt index.pdf \
4        README.html README.odt README.pdf \
5        mkws-manual.html mkws-manual.odt mkws-manual.pdf \
6        mkws-developer.html mkws-developer.odt mkws-developer.pdf
7
8 INSTALLABLE = index.html README.html mkws-manual.html mkws-developer.html mkws-doc.css
9 INSTALLED = $(INSTALLABLE:%=../tools/htdocs/%)
10
11 install: $(INSTALLED)
12
13 uninstall:
14         rm -f $(INSTALLED)
15
16 ../tools/htdocs/%: %
17         rm -f $@
18         cp -p $? $@
19         chmod ugo-w $@
20
21 all: $(DOCS)
22
23 # For a description of pandoc's markdown format, see:
24 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
25
26 # for older pandoc (<1.9) run first:
27 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/mkws-manual.markdown
28 #
29 %.html: %.markdown tweak-html
30         rm -f $@
31         pandoc --standalone --toc -c mkws-doc.css $< | ./tweak-html > $@
32         chmod ugo-w $@
33
34 %.odt: %.markdown
35         rm -f $@
36         pandoc --standalone $< -o $@
37         chmod ugo-w $@
38
39 # ### In order to compile the manual, which has tables, to PDF,
40 # you will need to install the Debian package
41 #       texlive-latex-recommended
42 %.pdf: %.markdown
43         rm -f $@
44         pandoc --standalone $< -o $@
45         chmod ugo-w $@
46
47 clean:
48         rm -f $(DOCS)
49         rm -f *.drupal.html
50
51 distclean: clean uninstall
52
53 push:
54         pandoc --toc README.markdown > README.drupal.html
55         pandoc --toc mkws-manual.markdown > mkws-manual.drupal.html
56         cat README.drupal.html | ./drupaljson.pl | curl --upload-file - http://www.indexdata.com/script/node/332?services_token=cda1e26e5733ce3f604773e94f0721df5c31a948 -v --header "Content-Type:application/json"
57         cat mkws-manual.drupal.html | ./drupaljson.pl | curl --upload-file - http://www.indexdata.com/script/node/323?services_token=cda1e26e5733ce3f604773e94f0721df5c31a948 -v --header "Content-Type:application/json"
58
59 help:
60         @echo "make [ all | install | clean | distclean | push ]"
61