summaryrefslogtreecommitdiffstats
path: root/bin/update_doc-index
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-01-06 20:49:07 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2010-01-06 20:49:07 +0100
commit92ebe66d850fb65965a63e85a1883fef5033c8b7 (patch)
tree5ea808d2ad509b71915ad80452892ead2b9e3209 /bin/update_doc-index
parent248328f31a47a10deeb1be3801d259e846cc16d2 (diff)
downloadhelper-scripts-92ebe66d850fb65965a63e85a1883fef5033c8b7.tar.gz
helper-scripts-92ebe66d850fb65965a63e85a1883fef5033c8b7.tar.xz
helper-scripts-92ebe66d850fb65965a63e85a1883fef5033c8b7.zip
added script for generating index of html docs in /usr/share/doc/HEADmaster
Diffstat (limited to '')
-rwxr-xr-xbin/update_doc-index20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/update_doc-index b/bin/update_doc-index
new file mode 100755
index 0000000..a64cf14
--- /dev/null
+++ b/bin/update_doc-index
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+(
+ echo "<ul>"
+
+ find /usr/share/doc -name 'index.html' | \
+ sed 's/index.html$//' | \
+ sort | \
+ awk '{
+ if (0 == index($1,OLD_PREFIX) || OLD_PREFIX=="") {
+ print $0
+ OLD_PREFIX=$1
+ }
+ }' | \
+ sed 's/$/index.html/
+ s/^\(.*\)$/<li><a href="\1">\1<\/a><\/li>/'
+
+ echo "</ul>"
+) > ~/doc_index.html
+