aboutsummaryrefslogtreecommitdiff
path: root/doc/cli.sh
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-06 23:13:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-06 23:13:49 +0300
commite74af960b4e0e79235a0625010eca9134fc1f8e4 (patch)
treedac7829adb8eea58173a43f052806163b5c71c02 /doc/cli.sh
parentbbf35703e8970b32c09bf6d5d104b8f9976ec5c3 (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.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/doc/cli.sh b/doc/cli.sh
index e59d6bc..be5dcbe 100755
--- a/doc/cli.sh
+++ b/doc/cli.sh
@@ -24,6 +24,18 @@ build2-toolchain-install*.pdf
esac
done
+function xhtml_to_ps () # <from> <to> [<html2ps-options>]
+{
+ local from="$1"
+ shift
+ local to="$1"
+ shift
+
+ cat "$from" | \
+ sed -e 's/├/|/g' -e 's/│/|/g' -e 's/─/-/g' -e 's/└/`/g' | \
+ html2ps "${@}" -o "$to"
+}
+
function gen () # <name>
{
local n="$1"
@@ -43,11 +55,11 @@ function gen () # <name>
--link-regex '%testscript(#.+)?%../../build2/doc/build2-testscript-manual.xhtml$1%' \
--output-prefix build2-toolchain- "${@}" $n.cli
-html2ps -f doc.html2ps:a4.html2ps -o build2-toolchain-$n-a4.ps build2-toolchain-$n.xhtml
-ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true build2-toolchain-$n-a4.ps build2-toolchain-$n-a4.pdf
+ xhtml_to_ps build2-toolchain-$n.xhtml build2-toolchain-$n-a4.ps -f doc.html2ps:a4.html2ps
+ ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true build2-toolchain-$n-a4.ps build2-toolchain-$n-a4.pdf
-html2ps -f doc.html2ps:letter.html2ps -o build2-toolchain-$n-letter.ps build2-toolchain-$n.xhtml
-ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true build2-toolchain-$n-letter.ps build2-toolchain-$n-letter.pdf
+ xhtml_to_ps build2-toolchain-$n.xhtml build2-toolchain-$n-letter.ps -f doc.html2ps:letter.html2ps
+ ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true build2-toolchain-$n-letter.ps build2-toolchain-$n-letter.pdf
}
gen intro