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