Cheat Sheet generation script bugfixes.

This commit is contained in:
Garth Minette 2020-08-31 18:03:48 -07:00
parent 7c42c7f5e3
commit 38a4c12032
2 changed files with 13 additions and 6 deletions

View file

@ -26,7 +26,7 @@ function columnize
hdrln1="| $(ucase $1) " hdrln1="| $(ucase $1) "
hdrln2='|:-----' hdrln2='|:-----'
n=1 n=1
while [[ $n < $maxcols ]] ; do while [[ $n -lt $maxcols ]] ; do
hdrln1+=' | &nbsp;' hdrln1+=' | &nbsp;'
hdrln2+=' |:------' hdrln2+=' |:------'
n=$(($n+1)) n=$(($n+1))
@ -34,7 +34,7 @@ function columnize
hdrln1+=' |' hdrln1+=' |'
hdrln2+=' |' hdrln2+=' |'
n=0 n=0
while [[ $n < $maxrows ]] ; do while [[ $n -lt $maxrows ]] ; do
lines[$n]="" lines[$n]=""
n=$(($n+1)) n=$(($n+1))
done done
@ -56,7 +56,7 @@ function columnize
echo $hdrln1 echo $hdrln1
echo $hdrln2 echo $hdrln2
n=0 n=0
while [[ $n < $maxrows ]] ; do while [[ $n -lt $maxrows ]] ; do
echo "| ${lines[$n]} |" echo "| ${lines[$n]} |"
n=$(($n+1)) n=$(($n+1))
done done
@ -67,6 +67,11 @@ function mkconstindex
sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s](%s#%s)\n", $3, $1, $3}' sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s](%s#%s)\n", $3, $1, $3}'
} }
function mkconstindex2
{
sed 's/ *=.*$//' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s](%s#%s)\n", $2, $1, $2}'
}
function mkotherindex function mkotherindex
{ {
sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s()](%s#%s)\n", $3, $1, $3}' sed 's/([^)]*)//g' | sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s()](%s#%s)\n", $3, $1, $3}'
@ -80,9 +85,11 @@ CHEAT_FILES=$(grep '^include' std.scad | sed 's/^.*<\([a-zA-Z0-9.]*\)>/\1/'|grep
echo '( [Alphabetic Index](Index) )' echo '( [Alphabetic Index](Index) )'
echo echo
for f in $CHEAT_FILES ; do for f in $CHEAT_FILES ; do
#echo "### $f"
( (
egrep -H 'Constant: ' $f | mkconstindex (
grep -H 'Constant: ' $f | mkconstindex
grep -H '^[A-Z$][A-Z0-9_]* *=.*//' $f | mkconstindex2
) | sort -u
egrep -H 'Function: |Function&Module: |Module: ' $f | mkotherindex egrep -H 'Function: |Function&Module: |Module: ' $f | mkotherindex
) | columnize $f ) | columnize $f
echo echo

View file

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