#!/bin/env bash set -e rm -rf std/ && mkdir -p std/ 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=$(cut -c8- <<<"$file") _prefix=$(cut -c8- <<<"$file" | sed -rn 's@^(.*)/.*$@\1@p') if ! [ "$prefix" = "$_prefix" ]; then prefix=$_prefix links="$links\n

std/$prefix

    " fi filename=$(sed s@/@_@g <<<"$name") links="$links\n
  1. :import $name
  2. " awk 'NR==FNR { gsub("<", "\\<", $0); gsub(">", "\\>", $0); a[n++]=$0; next } /CONTENT/ { for (i=0;i"std/$filename.html" sed -i -e "s@NAME@$name@g" "std/$filename.html" done sed -e "s@LINKS@$links@g" std.template >std/index.html cp res/* code.js content.css index.css code.css std/