2024-06-24 19:28:36 +00:00
|
|
|
#!/usr/bin/env bash
|
2024-03-29 19:06:55 +00:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2024-03-30 16:38:36 +00:00
|
|
|
lowdown_args=
|
2024-03-29 19:06:55 +00:00
|
|
|
|
2024-03-30 16:38:36 +00:00
|
|
|
if [ "$1" = --out-no-smarty ]; then
|
|
|
|
lowdown_args=--out-no-smarty
|
2024-03-29 19:06:55 +00:00
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2024-04-08 19:44:40 +00:00
|
|
|
[ "$#" = 4 ] || {
|
|
|
|
echo "wrong number of args passed" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2024-03-29 19:06:55 +00:00
|
|
|
title="$1"
|
|
|
|
section="$2"
|
|
|
|
infile="$3"
|
2024-04-08 19:44:40 +00:00
|
|
|
outfile="$4"
|
2024-03-29 19:06:55 +00:00
|
|
|
|
2024-04-08 19:44:40 +00:00
|
|
|
(
|
|
|
|
printf "Title: %s\n\n" "$title"
|
|
|
|
cat "$infile"
|
|
|
|
) | lowdown -sT man --nroff-nolinks $lowdown_args -M section="$section" -o "$outfile"
|