From 7de61941e1bc6e4efae322db317cf6b127cd287a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 Jun 2026 07:44:50 -0400 Subject: [PATCH] Change to pandoc for man rendering --- build/arm/noble/Dockerfile | 2 +- build/arm/resolute/Dockerfile | 2 +- confluent_client/makeman | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/build/arm/noble/Dockerfile b/build/arm/noble/Dockerfile index 0a8342cb..3f362e5e 100644 --- a/build/arm/noble/Dockerfile +++ b/build/arm/noble/Dockerfile @@ -3,7 +3,7 @@ ADD stdeb.patch /tmp/ ADD buildapt.sh /bin/ ADD distributions.tmpl /bin/ RUN ["apt-get", "update"] -RUN ["apt-get", "install", "-y", "reprepro", "python3-stdeb", "gnupg-agent", "devscripts", "debhelper", "libsoap-lite-perl", "libdbi-perl", "quilt", "git", "python3-pyparsing", "python3-netifaces", "dh-python", "libjson-perl", "ronn", "alien", "gcc", "make", "alien"] +RUN ["apt-get", "install", "-y", "reprepro", "python3-stdeb", "gnupg-agent", "devscripts", "debhelper", "libsoap-lite-perl", "libdbi-perl", "quilt", "git", "python3-pyparsing", "python3-netifaces", "dh-python", "libjson-perl", "pandoc", "alien", "gcc", "make", "alien"] RUN ["mkdir", "-p", "/sources/git/"] RUN ["mkdir", "-p", "/debs/"] RUN ["mkdir", "-p", "/apt/"] diff --git a/build/arm/resolute/Dockerfile b/build/arm/resolute/Dockerfile index b36681e2..39a1e8a7 100644 --- a/build/arm/resolute/Dockerfile +++ b/build/arm/resolute/Dockerfile @@ -3,7 +3,7 @@ ADD stdeb.patch /tmp/ ADD buildapt.sh /bin/ ADD distributions.tmpl /bin/ RUN ["apt-get", "update"] -RUN ["apt-get", "install", "-y", "reprepro", "python3-stdeb", "gnupg-agent", "devscripts", "debhelper", "libsoap-lite-perl", "libdbi-perl", "quilt", "git", "python3-pyparsing", "python3-dnspython", "python3-netifaces", "python3-asyncssh", "dh-python", "libjson-perl", "ronn", "alien", "gcc", "make"] +RUN ["apt-get", "install", "-y", "reprepro", "python3-stdeb", "gnupg-agent", "devscripts", "debhelper", "libsoap-lite-perl", "libdbi-perl", "quilt", "git", "python3-pyparsing", "python3-dnspython", "python3-netifaces", "python3-asyncssh", "dh-python", "libjson-perl", "pandoc", "alien", "gcc", "make"] RUN ["mkdir", "-p", "/sources/git/"] RUN ["mkdir", "-p", "/debs/"] RUN ["mkdir", "-p", "/apt/"] diff --git a/confluent_client/makeman b/confluent_client/makeman index a414dadc..54e0983e 100755 --- a/confluent_client/makeman +++ b/confluent_client/makeman @@ -5,7 +5,20 @@ cd `dirname $0`/doc/man mkdir -p ../../man/man1 mkdir -p ../../man/man5 mkdir -p ../../man/man8 -ronn -r *.ronn +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. + sed -E '/\([0-9]+\) *--+ /d; /^=+$/d' "$ronn" | \ + pandoc --standalone --from markdown --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/