annotate docs/build-docs.sh @ 1683:61eb734a16f3

Improve docs building process, filter example tfrc to replace few things with XML entities.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 01 Apr 2024 23:04:35 +0300
parents b60836ebb18c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #!/bin/sh
1683
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
2 CPWD="$(dirname "$(realpath "$0")")/"
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
3
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
4 cd "$CPWD"
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
5
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 ### Settings
1547
8212f5941566 Bump to DocBook 5.
Matti Hamalainen <ccr@tnsp.org>
parents: 1546
diff changeset
7 DOCBOOKBASE="/usr/share/xml/docbook/stylesheet/docbook-xsl-ns"
1045
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
8 UPURL="ccr@tnsp.org:public_html/ggrtf"
1683
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
9 TFPATH="${CPWD}../"
1045
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
10 SRCSGML="manual.sgml"
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
11 SRCXML="manual.xml"
1055
bb7806a7181c Remove ASCII format documentation generation; Remove redundant GhostScript PDF generation code.
Matti Hamalainen <ccr@tnsp.org>
parents: 1045
diff changeset
12 SRCFO="manual.fo"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
13 HTMLPATH="html"
1683
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
14 HTMLFILE="${HTMLPATH}/manual.html"
671
6d3d4d66c4c4 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 667
diff changeset
15 PDFFILE="manual.pdf"
640
6dc4d0b19975 Added CSS stylesheets to HTML output.
Matti Hamalainen <ccr@tnsp.org>
parents: 639
diff changeset
16 XSLTPARAMS="--stringparam html.stylesheet manual.css"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
17
1683
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
18 EXAMPLETFRC_SRC="${TFPATH}example-tfrc.txt"
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
19 EXAMPLETFRC_DST="example-tfrc-escaped.txt"
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
20
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
21 ### Get paths, if available
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
22 echo "* Initialization"
1641
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
23 CONVERT="$(which convert)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
24 PNMTOPS="$(which pnmtops)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
25 GIFTOPNM="$(which giftopnm)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
26 TIDY="$(which tidy)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
27 XSLTPROC="$(which xsltproc)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
28 FOP="$(which fop)"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
29 CATALOGS1="${DOCBOOKBASE}/xhtml/chunk.xsl"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
30 CATALOGS2="${DOCBOOKBASE}/xhtml/docbook.xsl"
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
31 CATALOGS3="${DOCBOOKBASE}/fo/docbook.xsl"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
32
1057
07d838735167 Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1055
diff changeset
33
1546
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
34 ### Check for locally installed FOP
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
35 echo -n "* Checking for FOP .. "
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
36 if test -n "$FOP" -a -x "$FOP"; then
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
37 echo "$FOP"
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
38 elif test -x "$HOME/tf/docs/fop/fop"; then
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
39 FOP="$HOME/tf/docs/fop/fop"
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
40 echo "$FOP"
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
41 else
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
42 echo "no"
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
43 fi
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
44
268
2b870ccb1b1d Convert images to EPS, if NetPBM is installed.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
45 ### Convert images
2b870ccb1b1d Convert images to EPS, if NetPBM is installed.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
46 echo "* Checking for image to EPS converting utilities ..."
1062
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
47 if test -n "$CONVERT" && test -x "$CONVERT"; then
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
48 echo "** GraphicsMagic/ImageMagick convert found"
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
49 for i in *.gif; do
1641
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
50 TOUTFILE="$(echo "$i" | sed "s/.gif/.eps/")"
1062
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
51 echo " - $i -> $TOUTFILE"
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
52 $CONVERT "$i" "$TOUTFILE"
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
53 done
bfaeec637a45 Prefer ImageMagick/GraphicsMagick over NetPBM utils.
Matti Hamalainen <ccr@tnsp.org>
parents: 1061
diff changeset
54 elif test -n "$PNMTOPS" && test -x "$PNMTOPS" && test -n "$GIFTOPNM" && test -x "$GIFTOPNM"; then
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
55 echo "** NetPBM tools found"
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
56 for i in *.gif; do
1641
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
57 TOUTFILE="$(echo "$i" | sed "s/.gif/.eps/")"
779
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
58 echo " - $i -> $TOUTFILE"
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
59 $GIFTOPNM "$i" | $PNMTOPS -scale=0.5 -noturn > "$TOUTFILE"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
60 done
268
2b870ccb1b1d Convert images to EPS, if NetPBM is installed.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
61 else
535
407993196f8e Better warnings
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
62 echo "*** WARNING! No supported image conversion tools found, not converting images."
407993196f8e Better warnings
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
63 echo "*** This may cause some document format conversions to fail or produce errors."
268
2b870ccb1b1d Convert images to EPS, if NetPBM is installed.
Matti Hamalainen <ccr@tnsp.org>
parents: 259
diff changeset
64 fi
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
66
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
67 ### Check that we have xsltproc installed for DocBook XML processing
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
68 if test -n "$XSLTPROC" && test -x "$XSLTPROC"; then
1231
Matti Hamalainen <ccr@tnsp.org>
parents: 1064
diff changeset
69 echo "* xsltproc found, good... testing for DocBook XML stuff .."
1540
1f18749befb4 Fix tests for catalogs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1530
diff changeset
70 if test -e "$CATALOGS1"; then
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
71 echo " * $CATALOGS1 found."
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
72 else
1644
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
73 echo "*** $CATALOGS1 not found!"
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
74 exit 1
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
75 fi
1540
1f18749befb4 Fix tests for catalogs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1530
diff changeset
76 if test -e "$CATALOGS2"; then
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
77 echo " * $CATALOGS2 found."
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
78 else
1644
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
79 echo "*** $CATALOGS2 not found!"
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
80 exit 1
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
81 fi
1540
1f18749befb4 Fix tests for catalogs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1530
diff changeset
82 if test -e "$CATALOGS3"; then
810
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
83 echo " * $CATALOGS3 found."
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
84 else
1644
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
85 echo "*** $CATALOGS3 not found!"
810
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
86 exit 1
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
87 fi
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 else
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
89 echo "*** ERROR! Could not find xsltproc! You need xsltproc and the"
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
90 echo "*** DocBook XML suite (with XSL stylesheets) to be able to"
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
91 echo "*** generate the documentation!"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
92 exit 1
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
93 fi
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
94
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
95
1683
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
96 ### Generate escaped version of example-tfrc
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
97 perl -pe 's@&@&amp;@g;s@<@&lt;@g;s@>@&gt;@g' < "$EXAMPLETFRC_SRC" > "$EXAMPLETFRC_DST"
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
98
61eb734a16f3 Improve docs building process, filter example tfrc to replace few things with XML entities.
Matti Hamalainen <ccr@tnsp.org>
parents: 1644
diff changeset
99
810
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
100 ### Generate kludge-normalized XML from the DocBook SGML source
1631
5a74247c16b5 Do not delete generated final DocBook XML.
Matti Hamalainen <ccr@tnsp.org>
parents: 1551
diff changeset
101 echo "* Running tfdoc .."
1064
dadf2faa4f35 Exit early if tfdoc or normalizeml fails.
Matti Hamalainen <ccr@tnsp.org>
parents: 1062
diff changeset
102 ( perl -w tfdoc.pl "$TFPATH" < "$SRCSGML" | perl -w normalizeml.pl > "$SRCXML" ) || exit 1
810
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
103
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
104
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
105 ### Generate HTML files
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
106 echo "* HTML"
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
107 if test -e "$HTMLPATH"; then
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
108 rm -fr "$HTMLPATH"
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 fi
305
127bc07f8d0f HTML directory was not deleted and re-created if it did not already exist,
Matti Hamalainen <ccr@tnsp.org>
parents: 274
diff changeset
110 mkdir -p "$HTMLPATH"
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
112 if test -d "$HTMLPATH"; then
1045
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
113 cp *.css *.png *.gif "$HTMLPATH" && cd "$HTMLPATH" && $XSLTPROC $XSLTPARAMS "$CATALOGS1" "../$SRCXML"
640
6dc4d0b19975 Added CSS stylesheets to HTML output.
Matti Hamalainen <ccr@tnsp.org>
parents: 639
diff changeset
114 cd "$CPWD"
274
b32bdb9db447 Copy images in HTML directory.
Matti Hamalainen <ccr@tnsp.org>
parents: 273
diff changeset
115
1045
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
116 if $XSLTPROC $XSLTPARAMS "$CATALOGS2" "$SRCXML" > "$HTMLFILE"; then
1231
Matti Hamalainen <ccr@tnsp.org>
parents: 1064
diff changeset
117 echo " * Transform successful."
779
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
118 else
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
119 echo "*** ERROR! $XSLTPROC failed. Quitting on fatal error."
1045
42900ba491db Use TFDoc in documentation building.
Matti Hamalainen <ccr@tnsp.org>
parents: 979
diff changeset
120 echo "*** Check $SRCXML for errors."
779
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
121 exit 2
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
122 fi
256
65f996b30766 Documentation building script.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123
1231
Matti Hamalainen <ccr@tnsp.org>
parents: 1064
diff changeset
124 echo " * Checking for HTML Tidy ..."
626
39fb83d9a2dc Refactored documentation generating.
Matti Hamalainen <ccr@tnsp.org>
parents: 535
diff changeset
125 if test -n "$TIDY" && test -x "$TIDY"; then
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
126 echo "** Found, cleaning up the mess by DocBook .."
979
24535e8e207e Change HTML TIDY's max line length to fix a stupid problem with certain "must be typed exactly as shown" BatMUD settings in the manual and additionally introduced hidden whitespaces.
Matti Hamalainen <ccr@tnsp.org>
parents: 846
diff changeset
127 if $TIDY -q -w 512 -utf8 -asxhtml -i -m $HTMLPATH/*.html "$HTMLFILE"; then
779
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
128 echo "** Tidying process successful."
ef7ec8837221 Improved building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 671
diff changeset
129 fi
535
407993196f8e Better warnings
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
130 else
667
6b608ea3f7af Improve warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 640
diff changeset
131 echo "*** WARNING! HTML tidy not found! To get better HTML output,"
6b608ea3f7af Improve warnings.
Matti Hamalainen <ccr@tnsp.org>
parents: 640
diff changeset
132 echo "*** please install HTML tidy (http://tidy.sourceforge.net/)"
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
133 fi
269
d049fe0beb05 Check for HTML Tidy and clean up HTML output if it is present.
Matti Hamalainen <ccr@tnsp.org>
parents: 268
diff changeset
134 fi
d049fe0beb05 Check for HTML Tidy and clean up HTML output if it is present.
Matti Hamalainen <ccr@tnsp.org>
parents: 268
diff changeset
135
810
3a37972d4215 Just some tweaks to docs building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 780
diff changeset
136
1546
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
137 ### Generate PDF
cfcbe5e0c12e Try to use FOP for converting to PDF.
Matti Hamalainen <ccr@tnsp.org>
parents: 1540
diff changeset
138 rm -f "$PDFFILE"
1644
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
139 if test -n "$FOP" && test -x "$FOP" && test -e "$SRCXML"; then
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
140 echo "* fop found, trying to generate PDF .."
1641
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
141 $XSLTPROC -o "$SRCFO" "$CATALOGS3" "$SRCXML" && \
7c64f9b16f8f Fixes to the documentation building process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1632
diff changeset
142 $FOP -pdf "$PDFFILE" -fo "$SRCFO"
1644
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
143 else
b60836ebb18c Minor adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1641
diff changeset
144 echo "* PDF requirements not satisfied."
1523
7f07eb4c80c6 Bump version.
Matti Hamalainen <ccr@tnsp.org>
parents: 1465
diff changeset
145 fi
639
d7b6d60112d5 Cleanups/fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
146
1550
bbe377cccd05 Remove temporary files generated during documentation build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1547
diff changeset
147 ## Remove temporary files
1631
5a74247c16b5 Do not delete generated final DocBook XML.
Matti Hamalainen <ccr@tnsp.org>
parents: 1551
diff changeset
148 #rm -f "$SRCXML"
1550
bbe377cccd05 Remove temporary files generated during documentation build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 1547
diff changeset
149
273
754a6e8fc369 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 269
diff changeset
150
671
6d3d4d66c4c4 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 667
diff changeset
151 ## Upload
1632
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
152 do_upload()
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
153 {
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
154 rsync -vptog --bwlimit=500 -e ssh "$@"
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
155 }
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
156
671
6d3d4d66c4c4 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 667
diff changeset
157 if test "x$1" = "x--upload"; then
1632
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
158 do_upload $HTMLPATH/* manual.css "$UPURL/html/"
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
159 do_upload "$PDFFILE" "$UPURL"
8bf2b62edd12 Use rsync for uploading.
Matti Hamalainen <ccr@tnsp.org>
parents: 1631
diff changeset
160 do_upload "$HOME/bin/tf5" "$UPURL/tf5.sh"
671
6d3d4d66c4c4 Improved docs building script.
Matti Hamalainen <ccr@tnsp.org>
parents: 667
diff changeset
161 fi