Generate apropos-like tables instead of filelists for manpages
[openssl-web.git] / bin / mk-apropos
diff --git a/bin/mk-apropos b/bin/mk-apropos
new file mode 100755 (executable)
index 0000000..a9dd5b6
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+# $1 is the top of the manual page tree to look through
+
+dir=$1
+cd $dir
+
+for m in `find . -name '*.html' | sort`; do
+    description=`grep -F '<!-- OSSL: description:' $m | sed -e 's|^[^:]*: *||' -e 's|^[^:]*: *||' -e 's| *-->||'`
+    manfile=`echo $m | sed -e 's|\./||'`
+    manname=`basename $manfile .html`
+    origmanfile=`echo $manfile | sed -e "s|^$subdir|$origsubdir|"`
+    echo "<tr><td><a href=\"$manfile\">$manname</a></td><td>$description</td></tr>"
+done