From 8ceb809c28f663bb1473722de3c6a24319888e61 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 7 May 2019 12:45:33 +0300 Subject: Convert UTF-8 tree characters to ASCII when producing PS from XHTML in doc/cli.sh --- doc/cli.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/cli.sh b/doc/cli.sh index 4d0ae3b..c727be7 100755 --- a/doc/cli.sh +++ b/doc/cli.sh @@ -62,6 +62,17 @@ done # Manuals. # +function xhtml_to_ps () # [] +{ + 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 () # { cli -I .. \ @@ -81,10 +92,10 @@ function compile_doc () # 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" } -- cgit v1.1