commit 9aa0ccf14f2a01689fc61d4f77cd389f8ae6b43a parent 4b4862419bcc606438475c900092f3601385f596 Author: Jacob R. Edwards <jacob@jacobedwards.org> Date: Sat, 20 Jan 2024 18:47:35 -0800 Allow saving compiled PDF from jourcomp Create the new script jourview to call mupdf(1) on the output of jourcomp (which is now the generated PDF). Diffstat:
| M | local/bin/bin/jourcomp | | | 8 | +------- |
| A | local/bin/bin/jourview | | | 7 | +++++++ |
| M | local/bin/bin/lec | | | 2 | +- |
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/local/bin/bin/jourcomp b/local/bin/bin/jourcomp @@ -1,12 +1,6 @@ #!/bin/ksh # compile journal entry compile -c() rm -f "$tmp" - file="${1:-"$(jourtail -1 | cut -d ' ' -f1)"}" -tmp="$(mktemp -t lecXXXXXX)" -trap c 0 INT TERM -preconv -e UTF-8 <"$file" | tbl | pic | groff "$@" -ms -T ps > "$tmp" -ps2pdf "$tmp" - | bwrite "$tmp" -mupdf "$tmp" +preconv -e UTF-8 <"$file" | tbl | pic | groff "$@" -ms -T pdf diff --git a/local/bin/bin/jourview b/local/bin/bin/jourview @@ -0,0 +1,7 @@ +#!/bin/ksh +# mupdf(1) the results of jourcomp + +tmp="$(mktemp -t jourviewXXXXXX)" +trap 'rm -f "$tmp"' 0 INT TERM +jourcomp "$@" > "$tmp" +mupdf "$tmp" diff --git a/local/bin/bin/lec b/local/bin/bin/lec @@ -1,4 +1,4 @@ #!/bin/ksh # last entry compile -exec jourcomp +exec jourview