coleslaw/plugins/rst.lisp
Alexander Artemenko 678ea7fe4a RST.lisp: Remove call to VISIT-NODE
WRITE-DOCUMENT method for all writers already calls VISIT-NODE.
2016-10-16 12:28:00 -05:00

22 lines
715 B
Common Lisp

(eval-when (:compile-toplevel :load-toplevel)
(ql:quickload 'docutils))
(defpackage :coleslaw-rst
(:use :cl)
(:import-from :coleslaw #:render-text)
(:import-from :docutils #:read-rst #:write-part #:register-settings-spec
#:visit-node #:write-document)
(:import-from :docutils.writer.html #:html-writer)
(:export #:enable))
(in-package :coleslaw-rst)
(defmethod render-text (text (format (eql :rst)))
(register-settings-spec '((:generator nil)
(:datestamp nil)))
(with-output-to-string (str)
(let ((writer (make-instance 'html-writer))
(document (read-rst text)))
(write-document writer document str))))
(defun enable ())