From 7c42c7f5e37114343dc34be3c4d93861f88ba581 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Mon, 31 Aug 2020 17:31:55 -0700 Subject: [PATCH] Added libfile names to index. --- scripts/genindex.sh | 36 ++++++++++++++++++++++++++++-------- version.scad | 2 +- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/scripts/genindex.sh b/scripts/genindex.sh index 9d3e8cd..51a9075 100755 --- a/scripts/genindex.sh +++ b/scripts/genindex.sh @@ -6,16 +6,18 @@ function ucase echo "$1" | tr '[:lower:]' '[:upper:]' } + function lcase { echo "$1" | tr '[:upper:]' '[:lower:]' } -function mkindex + +function alphaindex { - TMPFILE=$(mktemp -t $(basename $0).XXXXXX) || exit 1 - sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "- [%s](%s#%s)\n", $3, $1, $3}' | sort -d -f -u >> $TMPFILE alpha="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" + TMPFILE=$(mktemp -t $(basename $0).XXXXXX) || exit 1 + sort -d -f >> $TMPFILE for a in $alpha; do echo -n "[$a](#$(lcase "$a")) " done @@ -33,13 +35,31 @@ function mkindex } +function constlist +{ + sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "- [%s](%s#%s) (in %s)\n", $3, $1, $3, $1}' +} + +function constlist2 +{ + sed 's/ *=.*$//' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "- [%s](%s#%s) (in %s)\n", $2, $1, $2, $1}' +} + + +function funclist +{ + sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "- [%s()](%s#%s) (in %s)\n", $3, $1, $3, $1}' +} + + ( echo "## Belfry OpenScad Library Index" ( - grep 'Constant: ' *.scad - grep 'Function: ' *.scad - grep 'Function&Module: ' *.scad - grep 'Module: ' *.scad - ) | mkindex + ( + grep 'Constant: ' *.scad | constlist + grep '^[A-Z]* *=.*//' *.scad | constlist2 + ) | sort -u + egrep 'Function: |Function&Module: |Module: ' *.scad | sort -u | funclist + ) | sort | alphaindex ) > BOSL2.wiki/Index.md diff --git a/version.scad b/version.scad index bdbdafa..1d40e98 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,415]; +BOSL_VERSION = [2,0,416]; // Section: BOSL Library Version Functions