Comment on Debian packages required for PDFs.
[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 INSTALLABLE = index.html README.html mkws-manual.html mkws-developer.html mkws-doc.css
12 INSTALLED = $(INSTALLABLE:%=../tools/htdocs/%)
13
14 install: $(INSTALLED)
15
16 uninstall:
17         rm -f $(INSTALLED)
18
19 ../tools/htdocs/%: %
20         rm -f $@
21         cp -p $? $@
22         chmod ugo-w $@
23
24 all: $(DOCS)
25
26 # For a description of pandoc's markdown format, see:
27 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
28
29 # for older pandoc (<1.9) run first:
30 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/mkws-manual.markdown
31 #
32 %.html: %.markdown tweak-html
33         rm -f $@
34         pandoc --standalone --toc -c mkws-doc.css $< | ./tweak-html > $@
35         chmod ugo-w $@
36
37 # ### In order to compile the manual, which has tables, to PDF,
38 # you will need to install the Debian package
39 #       texlive-latex-recommended
40 %.pdf: %.markdown
41         rm -f $@
42         pandoc --standalone $< -o $@
43         chmod ugo-w $@
44
45 clean:
46         rm -f $(DOCS)
47         rm -f *.drupal.html
48
49 distclean: clean uninstall
50
51 push:
52         pandoc --toc README.markdown > README.drupal.html
53         pandoc --toc mkws-manual.markdown > mkws-manual.drupal.html
54         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"
55         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"
56
57 help:
58         @echo "make [ all | install | clean | distclean | push ]"
59