diff options
Diffstat (limited to 'docs/gen/md')
| -rwxr-xr-x | docs/gen/md | 23 |
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' |
