groffdown

Markdown to groff/troff conversion script.
Log | Files | Refs | README | LICENSE

commit 35e3b3c670eadd252e539cf90e6c57589359e858
parent 6767a21084d85cf553c56810e4dcd07a5f8794f8
Author: Benjamin Chausse <benjaminchausse@gmail.com>
Date:   Sat,  4 May 2019 00:11:46 -0400

More macro-compatibility & new gitignore for tests

Diffstat:
Mgroffdown | 29+++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/groffdown b/groffdown @@ -8,7 +8,10 @@ output=$( sed -e '1,1d s/title:/\.TL\n/ s/author:/\.AU\n/ s/date:/\.ND\n/ - s/---// + s/institution:/\.AI\n/ + + s/\\begin{abstract}/\.AB/ + s/\\end{abstract}/\.AE/ s/^\#####.\(.*\)/\.NH 5\n\1\n\.PP/g s/^\####.\(.*\)/\.NH 4\n\1\n\.PP/g @@ -17,22 +20,28 @@ output=$( sed -e '1,1d s/^\#.\(.*\)/\.NH 1\n\1\n\.PP/g s/\*\*\*\(.*\)\*\*\*$/\n\.BI\ \"\1\"\ /g - s/\*\*\(.*\)\*\*$/\n\.B\ \"\1\"\ /g - s/\*\(.*\)\*$/\n\.I\ \"\1\"\ /g - s/\*\*\*\(.*\)\*\*\*\(.\)$/\n\.BI\ \"\1\"\ \"\2\"/g - s/\*\*\(.*\)\*\*\(.\)$/\n\.B\ \"\1\"\ \"\2\"/g - s/\*\(.*\)\*\(.\)$/\n\.I\ \"\1\"\ \"\2\"/g - s/\*\*\*\(.*\)\*\*\*\(.\)/\n\.BI\ \"\1\"\ \"\2\"\n/g + + s/\*\*\(.*\)\*\*$/\n\.B\ \"\1\"\ /g + s/\*\*\(.*\)\*\*\(.\)$/\n\.B\ \"\1\"\ \"\2\"/g s/\*\*\(.*\)\*\*\(.\)/\n\.B\ \"\1\"\ \"\2\"\n/g + + s/\*\(.*\)\*$/\n\.I\ \"\1\"\ /g + s/\*\(.*\)\*\(.\)$/\n\.I\ \"\1\"\ \"\2\"/g s/\*\(.*\)\*\(.\)/\n\.I\ \"\1\"\ \"\2\"\n/g + s/`\(.*\)`$/\n\.CW\ \"\1\"\ /g + s/`\(.*\)`\(.\)$/\n\.CW\ \"\1\"\ \"\2\"/g + s/`\(.*\)`\(.\)/\n\.CW\ \"\1\"\ \"\2\"\n/g + + s/^-\ /.IP\ \\(bu\ 2\n/g + ' $1) -echo "$output" | groff -me -ms -kejpt -T pdf > $base.pdf +# echo "$output" | groff -me -ms -kejpt -T pdf > $base.pdf -# echo "$output" > $base.ms -# groff -ms $base.ms -T pdf > $base.pdf +echo "$output" > $base.ms +groff -ms $base.ms -T pdf > $base.pdf # echo "$output"