diff options
Diffstat (limited to 'docs/genstd.sh')
-rwxr-xr-x | docs/genstd.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/genstd.sh b/docs/genstd.sh index e028da8..a766826 100755 --- a/docs/genstd.sh +++ b/docs/genstd.sh @@ -4,11 +4,18 @@ set -e rm -rf std/ && mkdir -p std/ -files=$(find ../std/ -type f -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F '\0' '{print $3}') +files=$(find ../std/ -type f -name "*.bruijn" -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F '\0' '{print $3}') links="" +prefix="seeelefant" for file in $files; do - name=$(echo "$file" | cut -c8-) + name=$(cut -c8- <<<"$file") + _prefix=$(cut -c8- <<<"$file" | sed -rn 's@^(.*)/.*$@\1@p') + echo "$_prefix" + if ! [ "$prefix" = "$_prefix" ]; then + prefix=$_prefix + links="$links\n</ol><h2>std/$prefix</h2><ol>" + fi filename=$(sed s@/@_@g <<<"$name") links="$links\n<li><span class='com'>:import</span> <a href="$filename.html">$name</a></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" |