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

View file

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