dot

packages and services management
Log | Files | Refs | README

commit 8f883a8dd85d50b299dfb185fd16c2ee77bf1cba
parent 1aa5014d097aef9c6310e459ee1269afa6708d05
Author: Josuah Demangeonā  ā µ <mail@josuah.net>
Date:   Fri,  3 Mar 2017 12:05:13 -0500

Added an index generator

Diffstat:
Abin/index | 34++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+), 0 deletions(-)

diff --git a/bin/index b/bin/index @@ -0,0 +1,34 @@ +printf '<h2 id="%s">%s</h2>\n\n' 'blog' 'blog' + +find 'blog' -type d -mindepth 1 -maxdepth 1 | while IFS='' read -r dir +do + printf '<h3>%s</h3>' "${dir##*/}" + + printf '<ul>' + find "$dir" -type f -name "*.8" -mindepth 1 -maxdepth 1 | + while IFS='' read -r file + do + printf '<li>%s\n' "$(sed -n '/^.Nm/ s/^.Nm // p' "$file")" + printf '<nav>' + printf '<a href="%s">html</a> |' "${file%$EXT}" + printf '<a href="%s">8</a>' "$file" + printf '</nav>\n</li>\n' + done + printf '</ul>\n\n' +done + + +printf '<h2 id="%s">%s</h2>\n\n' 'news' 'news' + +printf '<ul>' +find 'news' -type f -name "*.8" -mindepth 1 -maxdepth 1 | while IFS='' read -r file +do + printf '<li>%s\n' "$(sed -n '/^.Nm/ s/^.Nm // p' "$file")" + printf '<nav>' + printf '<a href="%s">html</a> |' "${file%$EXT}" + printf '<a href="%s">%s</a>' "$file" "$EXT" + printf '</nav>\n</li>\n' +done +printf '</ul>\n\n' + +