Fix some bugs in the man page index generation.

This commit is contained in:
Jordan Bancino 2023-02-15 16:00:36 +00:00
parent de0ece10e2
commit 50aa65617a
2 changed files with 15 additions and 11 deletions

View file

@ -9,21 +9,24 @@ printf "</tr>"
find man -type f -name '*.[1-9]' | while IFS= read -r file; do
base=$(basename "$file")
name=$(echo "$base" | cut -d '.' -f 1)
section=$(echo "$base" | cut -d '.' -f 2)
name=$(echo "$base" | rev | cut -d '.' -f 2- | rev)
section=$(echo "$base" | rev | cut -d '.' -f 1)
description=$(grep '^\.Nd' "$file" | cut -d ' ' -f 2-)
prefix=$(echo "$name" | cut -d '-' -f 1)
if [ "$prefix" = "telodendria" ]; then
case "$prefix" in
"telodendria"*)
if [ "$1" = "dev" ]; then
continue
fi
else
;;
*)
if [ "$1" = "user" ]; then
continue
fi
fi
;;
esac
printf "<tr>"
printf "<td><a href=\"man/man$section/$name.$section.html\">$name($section)</a></td>"

View file

@ -76,6 +76,7 @@ setsubst() {
done
echo "s|\\\${[a-zA-Z_]*}||g"
echo "s|'''|'|g"
) > "$SED"
sed -f "$SED" $@