* Rename generateList to generateAppList * Add DocumenList with Generator * Rename Template files * Use template file for AppList.md * Ignore case when sorting AppList * Organize build folder * Add dependencies check to pre-commit script * Add wget install collumn to tools/README.md and sort by title * Remove Document table from README and add a link to DocumentList.md * Remove tools table from README and add a link to the list * Hightlight AppList on Readme
53 lines
1.3 KiB
Bash
Executable File
53 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# start script from it's folder
|
|
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null || exit
|
|
|
|
# Standard file locations
|
|
homedir='../../'
|
|
. ../env.sh
|
|
|
|
## Generate Doc Table
|
|
unset table
|
|
nDocs=$( jq '.docs | length' "$appinfo")
|
|
for doc in $(seq 0 $(( nDocs - 1 ))); do
|
|
info=$( jq ".docs | sort_by(.File) | .[$doc]" "$appinfo" )
|
|
|
|
# Get Doc ID
|
|
ID=$( echo "$info" | jq '.ID' | tr -d '"' )
|
|
|
|
# Get Doc Path
|
|
FILE=$( echo "$info" | jq '.File' | tr -d '"' )
|
|
|
|
# Get Doc Description
|
|
DESC=$( echo "$info" | jq '.Description' | tr -d '"' )
|
|
|
|
# YouTube Video
|
|
YT=$( jq ".youtube[] | select(.DocID==$ID) | .URL" "$appinfo" )
|
|
[ "$YT" != "" ] && YT="[]($YT)"
|
|
|
|
# Apps
|
|
APPS=$( jq ".apps[] | select(.DocID==$ID) | .Title" "$appinfo" | tr -d '"' )
|
|
if [ "$APPS" != "" ] && [ "$( echo "$APPS" | wc -l)" -gt "1" ] ; then
|
|
unset temp_app
|
|
while IFS="" read -r app || [ -n "$app" ]
|
|
do
|
|
if [ -z "$temp_app" ] ; then
|
|
temp_app="$app"
|
|
else
|
|
temp_app="$temp_app<br>$app"
|
|
fi
|
|
done < <( echo "$APPS" )
|
|
APPS="$temp_app"
|
|
fi
|
|
|
|
line="|[$FILE]($Docs$FILE)|$DESC|$APPS|$YT|"
|
|
if [ "$doc" == "0" ] ; then
|
|
table=$line
|
|
else
|
|
table=$( echo -e "$table\n$line")
|
|
fi
|
|
done
|
|
cp -f "$DocList_TEMPLATE" "$DocList"
|
|
echo -e "$table" >> "$DocList"
|