Mercurial > hg > batmud > ggrtf
diff 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 |
line wrap: on
line diff
--- a/docs/build-docs.sh Mon Apr 01 23:03:33 2024 +0300 +++ b/docs/build-docs.sh Mon Apr 01 23:04:35 2024 +0300 @@ -1,19 +1,25 @@ #!/bin/sh +CPWD="$(dirname "$(realpath "$0")")/" + +cd "$CPWD" + ### Settings DOCBOOKBASE="/usr/share/xml/docbook/stylesheet/docbook-xsl-ns" UPURL="ccr@tnsp.org:public_html/ggrtf" -TFPATH="../" +TFPATH="${CPWD}../" SRCSGML="manual.sgml" SRCXML="manual.xml" SRCFO="manual.fo" HTMLPATH="html" -HTMLFILE="$HTMLPATH/manual.html" +HTMLFILE="${HTMLPATH}/manual.html" PDFFILE="manual.pdf" XSLTPARAMS="--stringparam html.stylesheet manual.css" +EXAMPLETFRC_SRC="${TFPATH}example-tfrc.txt" +EXAMPLETFRC_DST="example-tfrc-escaped.txt" + ### Get paths, if available echo "* Initialization" -CPWD="$(pwd)" CONVERT="$(which convert)" PNMTOPS="$(which pnmtops)" GIFTOPNM="$(which giftopnm)" @@ -87,6 +93,10 @@ fi +### Generate escaped version of example-tfrc +perl -pe 's@&@&@g;s@<@<@g;s@>@>@g' < "$EXAMPLETFRC_SRC" > "$EXAMPLETFRC_DST" + + ### Generate kludge-normalized XML from the DocBook SGML source echo "* Running tfdoc .." ( perl -w tfdoc.pl "$TFPATH" < "$SRCSGML" | perl -w normalizeml.pl > "$SRCXML" ) || exit 1