summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-04-27 07:54:51 -0700
committerCraig Earls <enderw88@gmail.com>2014-04-27 07:54:51 -0700
commit04d147c9a7eef8f45801590574bf11fb3d111ab3 (patch)
tree941231c7c1e630017f1cdfbbe24693e3f69ea8bd /tools
parent62bdb2f13a31449ca6f439ee121162647c39855e (diff)
parentc933e7859922c04cafcd145090c7546e8d8d2d60 (diff)
downloadfork-ledger-04d147c9a7eef8f45801590574bf11fb3d111ab3.tar.gz
fork-ledger-04d147c9a7eef8f45801590574bf11fb3d111ab3.tar.bz2
fork-ledger-04d147c9a7eef8f45801590574bf11fb3d111ab3.zip
Merge pull request #281 from afh/pull/gendocs
Improve the documentation tools
Diffstat (limited to 'tools')
-rwxr-xr-xtools/gendocs.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/tools/gendocs.sh b/tools/gendocs.sh
index 9126a406..483f0230 100755
--- a/tools/gendocs.sh
+++ b/tools/gendocs.sh
@@ -1,5 +1,29 @@
#!/bin/bash
+
+# By default US Letter is used as the PDF papersize.
+# For those preferring other dimensions add a4 or small
+# as a commandline argument to this script to create a
+# DIN A4 or smallbook version of the PDF.
+case $1 in
+ a4*|afour*)
+ papersize='--texinfo=@afourpaper';;
+ small*)
+ papersize='--texinfo=@smallbook';;
+ *)
+ papersize='';; # US Letter is texinfo default
+esac
+
+# Use keg-only Mac Hombrew texinfo if installed.
+# Since texi2pdf is a shell script itself executing texi2dvi
+# PATH is prepended with the path to correct texinfo scripts.
+if [ $(uname -s) = 'Darwin' ]; then
+ brew list texinfo >/dev/null 2>&1 \
+ && export PATH="$(brew --prefix texinfo)/bin:$PATH"
+fi
+
echo "===================================== Making Info..."
makeinfo ledger3.texi
+echo "===================================== Making HTML..."
+makeinfo --html --no-split ledger3.texi
echo "===================================== Making PDF..."
-texi2pdf --quiet --batch ledger3.texi
+texi2pdf --quiet --batch ${papersize} ledger3.texi