make output from restructured text generator useable
This commit is contained in:
parent
ea81fddd96
commit
1b72440a61
1 changed files with 9 additions and 3 deletions
|
@ -4,14 +4,20 @@
|
|||
(defpackage :coleslaw-rst
|
||||
(:use :cl)
|
||||
(:import-from :coleslaw #:render-content)
|
||||
(:import-from :docutils #:read-rst
|
||||
#:write-html)
|
||||
(:import-from :docutils #:read-rst #:write-part #:register-settings-spec
|
||||
#:visit-node #:write-document)
|
||||
(:import-from :docutils.writer.html #:html-writer #:write-part)
|
||||
(:export #:enable))
|
||||
|
||||
(in-package :coleslaw-rst)
|
||||
|
||||
(defmethod render-content (text (format (eql :rst)))
|
||||
(register-settings-spec '((:generator nil)
|
||||
(:datestamp nil)))
|
||||
(with-output-to-string (str)
|
||||
(write-html str (read-rst text))))
|
||||
(let ((writer (make-instance 'html-writer))
|
||||
(document (read-rst text)))
|
||||
(visit-node writer document)
|
||||
(write-document writer document str))))
|
||||
|
||||
(defun enable ())
|
||||
|
|
Loading…
Add table
Reference in a new issue