diff options
author | Pjotr Prins | 2023-09-12 15:10:21 -0500 |
---|---|---|
committer | Pjotr Prins | 2023-09-12 15:10:21 -0500 |
commit | 3b7f80d4471036050e6416e029f2c76c8e468ed0 (patch) | |
tree | ce3fd3e7ba16104ca2897be07c693b733f053c52 /web/view/markdown.scm | |
parent | 278e35a4150bfcc18232be93857000032e60d484 (diff) | |
download | gn-guile-3b7f80d4471036050e6416e029f2c76c8e468ed0.tar.gz |
Adding markdown support
Diffstat (limited to 'web/view/markdown.scm')
-rw-r--r-- | web/view/markdown.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/web/view/markdown.scm b/web/view/markdown.scm new file mode 100644 index 0000000..b63e48d --- /dev/null +++ b/web/view/markdown.scm @@ -0,0 +1,17 @@ +(define-module (web view markdown) + #:use-module (json) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (ice-9 iconv) + #:use-module (ice-9 receive) + #:use-module (ice-9 string-fun) + #:use-module (ice-9 textual-ports) + #:use-module (sxml simple) + #:use-module (web sxml) + #:use-module (commonmark) + #:export (markdown-file->sxml)) + +(define (markdown-file->sxml fn) + (commonmark->sxml + (call-with-input-file fn + get-string-all))) |