commit e3cfaf6fa7dcf6a71200cadb7f2cf30375dc097e parent a2cf17233024a1d06f2c5ee3908124dca2d9beb0 Author: Jacob R. Edwards <jacob@jacobedwards.org> Date: Sun, 8 Oct 2023 08:39:19 -0700 Make a more general jourcomp and use it for lec The only difference is that jourcomp allows you to specify a file as an argument, and defaults to the last journal entry whereas lec only compiled the last entry. Now lec just calls jourcomp without any arguments. Diffstat:
| A | local/bin/bin/jourcomp | | | 12 | ++++++++++++ |
| M | local/bin/bin/lec | | | 10 | +--------- |
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/local/bin/bin/jourcomp b/local/bin/bin/jourcomp @@ -0,0 +1,12 @@ +#!/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" diff --git a/local/bin/bin/lec b/local/bin/bin/lec @@ -1,12 +1,4 @@ #!/bin/ksh # last entry compile -c() rm -f "$tmp" - -file="$(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" +exec jourcomp