diff options
Diffstat (limited to 'z.scm')
-rw-r--r-- | z.scm | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -43,6 +43,18 @@ (define (subprocess.call argv) (apply system* argv)) +(import (ice-9 receive)) +(import (only (ice-9 rdelim) read-string)) +(define (pandoc text) + (receive (from to pid) + ((@@ (ice-9 popen) open-process) OPEN_BOTH + "pandoc" "-f" "markdown" "-t" "html") + (display text to) + (close to) + (let ((ret (read-string from))) + (close from) + ret))) + ;; z program (define *zdir* (os.path.expanduser "~/test-z-wiki")) @@ -254,8 +266,13 @@ NL < '\n' [("node" id) (let* ([node (load-node (string->id id))] [txt (or (get-content node) "")]) - (respond `((pre ,txt)) - #:title (fmt "z - ~a" (title node))))] + (respond + `(,(->> txt + pandoc + ;; wrap in article tags so sxml includes all of the content + ((/. s (string.str "<article>" s "</article>"))) + xml->sxml)) + #:title (fmt "z - ~a" (title node))))] [("tag") (begin (reindex) |