# HG changeset patch # User Matti Hamalainen # Date 1712001875 -10800 # Node ID 61eb734a16f3f76dfe22a30938ecd8840a8dcb31 # Parent de46e2e23c661e873d6558ac0a487745b5ea6e60 Improve docs building process, filter example tfrc to replace few things with XML entities. diff -r de46e2e23c66 -r 61eb734a16f3 docs/build-docs.sh --- 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 diff -r de46e2e23c66 -r 61eb734a16f3 docs/manual.sgml --- a/docs/manual.sgml Mon Apr 01 23:03:33 2024 +0300 +++ b/docs/manual.sgml Mon Apr 01 23:04:35 2024 +0300 @@ -12,7 +12,7 @@ BatMUD"> GnuPG"> - + on, off">