aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-04 22:50:04 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-04 22:50:04 -0400
commite6feddc952ecb232ac0304ffa698ae707ac39cdb (patch)
treead3a57e93abed22682d34a8b820a2cdcaddbaf8e /scripts
parent65abfec720806e641c64471104d592aaafed26f7 (diff)
Renamed doc/ to docs/ and removed bombay dependency.
Added some documentation infrastructure for eventual migration to a new build service. Use a simple Lua script for generating documentation offline.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_doc.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/gen_doc.lua b/scripts/gen_doc.lua
new file mode 100755
index 00000000..1d317935
--- /dev/null
+++ b/scripts/gen_doc.lua
@@ -0,0 +1,11 @@
+#!/usr/bin/lua
+-- Part of a pipeline that fills in simple {{ variable }} templates when
+-- generating documentation offline.
+-- cat file.md | markdown | gen_doc > file.html
+
+local html = io.read('*a')
+local f = io.open('../docs/_layouts/default.html')
+io.write(
+ f:read('*a'):gsub('{{ page.title }}', html:match('<h%d>([^<]+)')):
+ gsub('{{ content }}', (html:gsub('%%', '%%%%'))))
+f:close()