2012-08-14 23:56:25 -04:00
|
|
|
(eval-when (:compile-toplevel :load-toplevel)
|
|
|
|
(ql:quickload 'docutils))
|
|
|
|
|
|
|
|
(defpackage :coleslaw-rst
|
2013-01-29 20:38:16 -05:00
|
|
|
(:use :cl)
|
2014-04-15 23:43:10 -04:00
|
|
|
(:import-from :coleslaw #:render-text)
|
2014-03-01 22:27:17 -05:00
|
|
|
(:import-from :docutils #:read-rst #:write-part #:register-settings-spec
|
|
|
|
#:visit-node #:write-document)
|
|
|
|
(:import-from :docutils.writer.html #:html-writer #:write-part)
|
2013-01-29 20:38:16 -05:00
|
|
|
(:export #:enable))
|
2012-08-14 23:56:25 -04:00
|
|
|
|
|
|
|
(in-package :coleslaw-rst)
|
2013-01-29 20:38:16 -05:00
|
|
|
|
2014-04-15 23:43:10 -04:00
|
|
|
(defmethod render-text (text (format (eql :rst)))
|
2014-03-01 22:27:17 -05:00
|
|
|
(register-settings-spec '((:generator nil)
|
|
|
|
(:datestamp nil)))
|
2013-01-29 20:38:16 -05:00
|
|
|
(with-output-to-string (str)
|
2014-03-01 22:27:17 -05:00
|
|
|
(let ((writer (make-instance 'html-writer))
|
|
|
|
(document (read-rst text)))
|
|
|
|
(visit-node writer document)
|
|
|
|
(write-document writer document str))))
|
2013-01-29 20:38:16 -05:00
|
|
|
|
|
|
|
(defun enable ())
|