aboutsummaryrefslogtreecommitdiff
path: root/doc/cli.sh
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-07 12:31:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-07 12:31:45 +0300
commit31d1aaebc21fd9ed3c47b167687701a8ed5062f7 (patch)
tree3892822c6a412bde29de968a618ed065944daa09 /doc/cli.sh
parentbb386e095785d0c50b5704f2b23edbe0c790443d (diff)
Convert UTF-8 tree characters to ASCII when producing PS from XHTML in doc/cli.sh
Diffstat (limited to 'doc/cli.sh')
-rwxr-xr-xdoc/cli.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/cli.sh b/doc/cli.sh
index 3f50fad..65b4c3c 100755
--- a/doc/cli.sh
+++ b/doc/cli.sh
@@ -60,6 +60,17 @@ done
# Manuals.
#
+function xhtml_to_ps () # <from> <to> [<html2ps-options>]
+{
+ local from="$1"
+ shift
+ local to="$1"
+ shift
+
+ sed -e 's/├/|/g' -e 's/│/|/g' -e 's/─/-/g' -e 's/└/`/g' "$from" | \
+ html2ps "${@}" -o "$to"
+}
+
function compile_doc () # <file> <prefix> <suffix>
{
cli -I .. \
@@ -75,10 +86,10 @@ function compile_doc () # <file> <prefix> <suffix>
local n="$2$(basename -s .cli $1)$3"
- html2ps -f doc.html2ps:a4.html2ps -o "$n-a4.ps" "$n.xhtml"
+ xhtml_to_ps "$n.xhtml" "$n-a4.ps" -f doc.html2ps:a4.html2ps
ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true "$n-a4.ps" "$n-a4.pdf"
- html2ps -f doc.html2ps:letter.html2ps -o "$n-letter.ps" "$n.xhtml"
+ xhtml_to_ps "$n.xhtml" "$n-letter.ps" -f doc.html2ps:letter.html2ps
ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true "$n-letter.ps" "$n-letter.pdf"
}