-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (35 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
html: src/*.xml html.xsl Makefile
# xsltproc --xinclude --stringparam html.stylesheet "../css/bootstrap.min.css ../css/bootstrap-responsive.min.css ../css/styled.min.css ../css/highlight.css" --path "src css" --output build/ html.xsl c.xml
xsltproc --xinclude --stringparam html.stylesheet "../css/styled.min.css" --path "src css" --output build/ html.xsl c.xml
# perl -pi -e "s/\.pdf\"/\.png\"/g;" src/*.xml
# find . -name "*.html" | xargs perl -pi -e "s/<html>/<!DOCTYPE html>/g;"
# find . -name "*.html" | xargs perl -pi -e "s/<meta/<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta/g;"
cp -r images build/
./domp.py
mkdir -p /var/www/c-programming/
cp -r build/* /var/www/c-programming/
pdf: src/*.xml dblatex.xsl Makefile
#rm -rf pdf
cp -r src pdf
dblatex -bxetex -T db2latex -p dblatex.xsl -P preface.tocdepth="1" -t tex src/c.xml -o pdf/c.tex
perl -pi -e "s/\.png/\.pdf/g;" pdf/c.tex
./lstlisting_to_minted.sh
cd pdf && xelatex -shell-escape c.tex #&& xelatex -shell-escape c.tex
cd pdf && makeindex c.tex
cd pdf && xelatex -shell-escape c.tex #&& xelatex -shell-escape c.tex
latex:
dblatex -bxetex -T db2latex -p dblatex.xsl -P preface.tocdepth="1" -t tex src/c.xml
cd src && perl -pi -e "s/\.png/\.pdf/g;" c.tex
fop:
# cd src && xmllint --xinclude c.xml>resolvedc.xml
xsltproc --xinclude --output src/c.fo fop.xsl src/c.xml
perl -pi -e "s/png/pdf/g;" src/c.fo
# ./fop.py
# perl -pi -e "s/<html><body>//g;" src/c.fo
# perl -pi -e "s/<\/body><\/html>//g;" src/c.fo
cd src && fop c.fo c.pdf
epub: src/*.xml epub.xsl Makefile
xsltproc --xinclude --stringparam html.stylesheet "../css/one.min.css" --path "src css" epub.xsl c.xml
cp -r images/*.png OEBPS
./epub.py
zip -r c.epub mimetype css META-INF/ OEBPS/