Welcome to the CHICKEN Scheme pasting service

rst->html pasted by wasamasa on Mon Aug 17 09:47:45 2015

(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)))))

Now with less redundancy! added by wasamasa on Mon Aug 17 09:55:11 2015

(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))
         (html (serialize-sxml ((sxpath "//body/div/node()") dom))))
      (display html)))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which module provides `process-wait'?
Visually impaired? Let me spell it for you (wav file) download WAV