aboutsummaryrefslogtreecommitdiff
path: root/web/view/markdown.scm
blob: b63e48d85388242c9388f139a5b6fde8a9ffef76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)))