mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 21:58:27 +01:00
Tweak index format
This commit is contained in:
parent
d320940654
commit
5abc7db530
@ -14,14 +14,15 @@ function lcase
|
|||||||
function mkindex
|
function mkindex
|
||||||
{
|
{
|
||||||
TMPFILE=$(mktemp -t $(basename $0)) || exit 1
|
TMPFILE=$(mktemp -t $(basename $0)) || exit 1
|
||||||
sed 's/[^a-zA-Z0-9_.:$]//g' | awk -F ':' '{printf "[%s](%s#%s)\n", $3, $1, $3}' | sort -d -f -u >> $TMPFILE
|
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"
|
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"
|
||||||
for a in $alpha; do
|
for a in $alpha; do
|
||||||
echo -n "[$a](#$(lcase "$a")) "
|
echo -n "[$a](#$(lcase "$a")) "
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
echo
|
||||||
for a in $alpha; do
|
for a in $alpha; do
|
||||||
links=$(cat $TMPFILE | grep -i "^.[$(lcase "$a")]")
|
links=$(cat $TMPFILE | grep -i "^- .[$(lcase "$a")]")
|
||||||
if [ "$links" != "" ]; then
|
if [ "$links" != "" ]; then
|
||||||
echo "### $(ucase "$a")"
|
echo "### $(ucase "$a")"
|
||||||
echo "$links"
|
echo "$links"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user