Mercurial > hg > batmud > ggrtf
comparison 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 |
comparison
equal
deleted
inserted
replaced
1682:de46e2e23c66 | 1683:61eb734a16f3 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 CPWD="$(dirname "$(realpath "$0")")/" | |
3 | |
4 cd "$CPWD" | |
5 | |
2 ### Settings | 6 ### Settings |
3 DOCBOOKBASE="/usr/share/xml/docbook/stylesheet/docbook-xsl-ns" | 7 DOCBOOKBASE="/usr/share/xml/docbook/stylesheet/docbook-xsl-ns" |
4 UPURL="ccr@tnsp.org:public_html/ggrtf" | 8 UPURL="ccr@tnsp.org:public_html/ggrtf" |
5 TFPATH="../" | 9 TFPATH="${CPWD}../" |
6 SRCSGML="manual.sgml" | 10 SRCSGML="manual.sgml" |
7 SRCXML="manual.xml" | 11 SRCXML="manual.xml" |
8 SRCFO="manual.fo" | 12 SRCFO="manual.fo" |
9 HTMLPATH="html" | 13 HTMLPATH="html" |
10 HTMLFILE="$HTMLPATH/manual.html" | 14 HTMLFILE="${HTMLPATH}/manual.html" |
11 PDFFILE="manual.pdf" | 15 PDFFILE="manual.pdf" |
12 XSLTPARAMS="--stringparam html.stylesheet manual.css" | 16 XSLTPARAMS="--stringparam html.stylesheet manual.css" |
13 | 17 |
18 EXAMPLETFRC_SRC="${TFPATH}example-tfrc.txt" | |
19 EXAMPLETFRC_DST="example-tfrc-escaped.txt" | |
20 | |
14 ### Get paths, if available | 21 ### Get paths, if available |
15 echo "* Initialization" | 22 echo "* Initialization" |
16 CPWD="$(pwd)" | |
17 CONVERT="$(which convert)" | 23 CONVERT="$(which convert)" |
18 PNMTOPS="$(which pnmtops)" | 24 PNMTOPS="$(which pnmtops)" |
19 GIFTOPNM="$(which giftopnm)" | 25 GIFTOPNM="$(which giftopnm)" |
20 TIDY="$(which tidy)" | 26 TIDY="$(which tidy)" |
21 XSLTPROC="$(which xsltproc)" | 27 XSLTPROC="$(which xsltproc)" |
85 echo "*** generate the documentation!" | 91 echo "*** generate the documentation!" |
86 exit 1 | 92 exit 1 |
87 fi | 93 fi |
88 | 94 |
89 | 95 |
96 ### Generate escaped version of example-tfrc | |
97 perl -pe 's@&@&@g;s@<@<@g;s@>@>@g' < "$EXAMPLETFRC_SRC" > "$EXAMPLETFRC_DST" | |
98 | |
99 | |
90 ### Generate kludge-normalized XML from the DocBook SGML source | 100 ### Generate kludge-normalized XML from the DocBook SGML source |
91 echo "* Running tfdoc .." | 101 echo "* Running tfdoc .." |
92 ( perl -w tfdoc.pl "$TFPATH" < "$SRCSGML" | perl -w normalizeml.pl > "$SRCXML" ) || exit 1 | 102 ( perl -w tfdoc.pl "$TFPATH" < "$SRCSGML" | perl -w normalizeml.pl > "$SRCXML" ) || exit 1 |
93 | 103 |
94 | 104 |