diff options
author | Marvin Borner | 2024-08-20 13:51:00 +0200 |
---|---|---|
committer | Marvin Borner | 2024-08-20 13:51:00 +0200 |
commit | 35bb7ca1422ef20a80cd071e2e5dc6f8842fb5a7 (patch) | |
tree | ef3a5a9873bec914317fb617772d53fd37240fc2 /docs/genstd.sh | |
parent | db5cb16522329d3b313967d4f491dc320b549b8d (diff) |
Added basic std alias detection
Diffstat (limited to 'docs/genstd.sh')
-rwxr-xr-x | docs/genstd.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/genstd.sh b/docs/genstd.sh index f2c0dd4..6a59426 100755 --- a/docs/genstd.sh +++ b/docs/genstd.sh @@ -20,7 +20,12 @@ for file in $files; do filename=$(sed s@/@_@g <<<"$name") ndefs=$(grep -cP "^[^:# \t]" "$file" || true) ntests=$(grep -cP "^:test" "$file" || true) - links="$links\n<li><span class='com'>:import</span> <a href=$filename.html>$(basename "$name" .bruijn)</a> <span class='stats'>($ndefs definitions, $ntests tests)</span></li>" + if [ "$ndefs" = 0 ]; then + stats="<span class='stats'>(alias)</span>" + else + stats="<span class='stats'>($ndefs definitions, $ntests tests)</span>" + fi + links="$links\n<li><span class='com'>:import</span> <a href=$filename.html>$(basename "$name" .bruijn)</a> $stats</li>" awk 'NR==FNR { gsub("<", "\\<", $0); gsub(">", "\\>", $0); a[n++]=$0; next } /CONTENT/ { for (i=0;i<n;++i) print a[i]; next } 1' "$file" content.template >"std/$filename.html" sed -i -e "s@NAME@$name@g" -e "s@INFO@@g" "std/$filename.html" |