aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxj92019-10-26 14:29:05 -0600
committerxj92019-10-26 14:29:05 -0600
commite32f9dcc6d1be3fada43d1da391fdd84ec1890c6 (patch)
tree95dad1b4e8c64a945f580abf737b1e7f2494824a
parent29e64dfe008dbfbdd23bcf21b909b4b2facad40b (diff)
downloadtracker-format-e32f9dcc6d1be3fada43d1da391fdd84ec1890c6.tar.gz
tracker-format-e32f9dcc6d1be3fada43d1da391fdd84ec1890c6.tar.xz
add render program
-rw-r--r--render.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/render.scm b/render.scm
new file mode 100644
index 0000000..d326cc8
--- /dev/null
+++ b/render.scm
@@ -0,0 +1,19 @@
+(import (chicken io))
+(import (sxml-transforms))
+(import lowdown)
+
+(define parse-file
+ (lambda (file-name)
+ (markdown->sxml (call-with-input-file
+ file-name
+ (lambda (port)
+ (read-string #f port))))))
+(define render
+ (lambda (file-name)
+ (let ((parsed (parse-file file-name)))
+ (SXML->HTML parsed))))
+
+(define main
+ (lambda (args . b)
+ (let ((file-name (car args)))
+ (render file-name))))