aboutsummaryrefslogtreecommitdiffstats
path: root/docs/gen/md
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-04-17 14:08:45 +0000
committers-ol <s-ol@users.noreply.github.com>2020-04-17 14:08:45 +0000
commitaedd7f485397b322fc88c60241fa1e5e684fd2b4 (patch)
tree2727053dbe2b8585430e20d779a2b25c9bae0d2b /docs/gen/md
parentremove defunct alv-copilot.bat (diff)
downloadalive-aedd7f485397b322fc88c60241fa1e5e684fd2b4.tar.gz
alive-aedd7f485397b322fc88c60241fa1e5e684fd2b4.zip
move extra/ to docs/gen/ and split up
Diffstat (limited to 'docs/gen/md')
-rwxr-xr-xdocs/gen/md23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/gen/md b/docs/gen/md
new file mode 100755
index 0000000..32d4fdd
--- /dev/null
+++ b/docs/gen/md
@@ -0,0 +1,23 @@
+#!/usr/bin/env moon
+import layout, autoref from require 'docs.gen.layout'
+import compile from require 'discount'
+
+export OUT, ESCAPE
+
+slurp = (file) ->
+ file = io.open file, 'r'
+ with file\read '*all'
+ file\close!
+
+spit = (file, str) ->
+ file = io.open file, 'w'
+ file\write str
+ file\close!
+
+ESCAPE = (str) ->
+ (str\gsub '([*`])', '\\%1')
+
+{ OUT, file } = arg
+
+contents = slurp file
+spit OUT, layout compile (autoref contents), 'githubtags', 'fencedcode'