Added libfile names to index.

This commit is contained in:
Garth Minette 2020-08-31 17:31:55 -07:00
parent 3cba94efdc
commit 7c42c7f5e3
2 changed files with 29 additions and 9 deletions

View file

@ -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

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,415];
BOSL_VERSION = [2,0,416];
// Section: BOSL Library Version Functions