Moved text files to "en" subdirectory.
[gitmagic/gitmagic.git] / Makefile
blob9de27c852b96ff54f78e293f52e6cee6f9afb546
1 .PHONY: target clean sync push
3 target: book book/default.css book.html book.pdf
5 # The book consists of these text files in the following order:
7 TXTFILES=preface.txt intro.txt basic.txt clone.txt branch.txt history.txt \
8 grandmaster.txt secrets.txt drawbacks.txt
10 LANG=en
12 book.xml: $(addprefix $(LANG)/,$(TXTFILES))
13 ( for FILE in $^ ; do cat $$FILE ; echo ; done ) | asciidoc -d book -b docbook - > $@
15 # Ignore tidy's exit code because Asciidoc generates section IDs beginning with
16 # "_", which xmlto converts to "id" attributes of <a> tags. The standard
17 # insists that "id" attributes begin with a letter, which causes tidy to
18 # print a warning and return a nonzero code.
20 # When Asciidoc 8.3.0+ is widespread, I'll use its idprefix attribute instead
21 # of ignoring return codes.
23 book: book.xml
24 xmlto -m custom-html.xsl -o book html book.xml
25 sed -i 's/xmlns:fo[^ ]*//g' book/*.html
26 -ls book/*.html | xargs -n 1 tidy -utf8 -m -i -q
27 ./makeover
29 book/default.css: book.css
30 -mkdir book
31 rsync book.css book/default.css
33 book.html: book.xml
34 xmlto -m custom-nochunks.xsl html-nochunks $^
35 -tidy -utf8 -imq $@
37 book.pdf: book.xml
38 docbook2pdf book.xml
40 clean:
41 -rm -rf book.xml book.html book
43 sync: target
44 rsync -r book.html book.pdf book/* blynn@tl1.stanford.edu:www/gitmagic/
46 public:
47 git push blynn@git.or.cz:srv/git/gitmagic.git
48 git push git@github.com:blynn/gitmagic.git