2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-12-01 06:42:17 +00:00
Files
confluent/confluent_client/makeman
T
Markus Hilger 6e628e9a87 Keep placeholders in man pages
pandoc read placeholders such as <scratchdir> as HTML tags and dropped
them from the man pages, so the imgutil synopsis showed
"imgutil build []". Read the ronn files without raw HTML, so they stay
text. Ten pages lost placeholders this way, the others are unchanged.
2026-11-25 22:00:32 +01:00

28 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
cd `dirname $0`
python3 addattribs.py || python2 addattribs.py
cd `dirname $0`/doc/man
mkdir -p ../../man/man1
mkdir -p ../../man/man5
mkdir -p ../../man/man8
for ronn in *.ronn; do
# The first heading line is of the form "name(section) -- description"
header=`grep -m1 -E '\([0-9]+\) *--+ ' "$ronn"`
name=`echo "$header" | sed -E 's/^#* *([A-Za-z0-9._-]+)\(([0-9]+)\).*/\1/'`
section=`echo "$header" | sed -E 's/^#* *([A-Za-z0-9._-]+)\(([0-9]+)\).*/\2/'`
# Strip the ronn title heading (and any setext underline) and promote the
# remaining section headings so pandoc emits them as man .SH sections.
# Without raw_html, placeholders like <noderange> stay text instead of
# being read as HTML tags and dropped.
sed -E '/\([0-9]+\) *--+ /d; /^=+$/d' "$ronn" | \
pandoc --standalone --from markdown-raw_html --to man \
--shift-heading-level-by=-1 \
--metadata title="$name" \
--metadata section="$section" \
-o "$name.$section"
done
mv *.1 ../../man/man1/
mv *.5 ../../man/man5/
mv *.8 ../../man/man8/