(define (rst->html) (let* ((rst (make-external-translator "rst2html" (lambda () (list "--link-stylesheet" "--syntax-highlight=short" "--smart-quotes=yes" "--trim-footnote-reference-space")))) (dom (with-input-from-string (with-output-to-string rst) html->sxml)) ;; HACK: retrieve unwrapped document content (html (serialize-sxml (cdddar (cddar ((sxpath "//body") dom)))))) (with-output-to-port (current-output-port) (lambda () (display html)))))