Fix MKWS-286.
[mkws-moved-to-github.git] / doc / Makefile
1 # Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
2 #
3 # To build the PDFs, you will need these Debian packages:
4 #       texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
5
6 DOCS = index.html index.pdf \
7        README.html README.pdf \
8        mkws-manual.html mkws-manual.pdf \
9        mkws-developer.html mkws-developer.pdf
10
11 INSTALLED = $(DOCS:%=../tools/htdocs/%)
12
13 all: $(INSTALLED)
14
15 # For a description of pandoc's markdown format, see:
16 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html
17
18 # for older pandoc (<1.9) run first:
19 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/mkws-manual.markdown
20 #
21 ../tools/htdocs/%.html: %.markdown tweak-html
22         rm -f $@
23         pandoc --standalone --toc -c mkws-doc.css $< | ./tweak-html > $@
24         chmod ugo-w $@
25
26 # ### In order to compile the manual, which has tables, to PDF,
27 # you will need to install the Debian package
28 #       texlive-latex-recommended
29 ../tools/htdocs/%.pdf: %.markdown
30         rm -f $@
31         pandoc --standalone $< -o $@
32         chmod ugo-w $@
33
34 clean:
35         rm -f $(INSTALLED)
36         rm -f *.drupal.html
37
38 push:
39         pandoc --toc README.markdown > README.drupal.html
40         pandoc --toc mkws-manual.markdown > mkws-manual.drupal.html
41         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"
42         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"
43
44 help:
45         @echo "make [ all | clean | push ]"
46