aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/gen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gen.sh')
-rwxr-xr-xdocs/gen.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/gen.sh b/docs/gen.sh
new file mode 100755
index 0000000..4e7a80b
--- /dev/null
+++ b/docs/gen.sh
@@ -0,0 +1,20 @@
+#!/bin/env bash
+
+set -e
+
+rm -rf std/ && mkdir -p std/
+
+files=$(find ../std/ -type f | sort)
+links=""
+
+for file in $files; do
+ name=$(echo $file | cut -c8-)
+ 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("<", "\\&lt;", $0); gsub(">", "\\&gt;", $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" std/$filename.html
+done
+
+sed -e "s@LINKS@$links@g" index.template >std/index.html
+
+cp content.js content.css index.css std/