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