summaryrefslogtreecommitdiffstats
path: root/bin
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
parent248328f31a47a10deeb1be3801d259e846cc16d2 (diff)
downloadhelper-scripts-master.tar.gz
helper-scripts-master.tar.xz
helper-scripts-master.zip
added script for generating index of html docs in /usr/share/doc/HEADmaster
Diffstat (limited to 'bin')
-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
+