|
@@ -4,14 +4,20 @@
|
4
|
4
|
(defpackage :coleslaw-rst
|
5
|
5
|
(:use :cl)
|
6
|
6
|
(:import-from :coleslaw #:render-content)
|
7
|
|
- (:import-from :docutils #:read-rst
|
8
|
|
- #:write-html)
|
|
7
|
+ (:import-from :docutils #:read-rst #:write-part #:register-settings-spec
|
|
8
|
+ #:visit-node #:write-document)
|
|
9
|
+ (:import-from :docutils.writer.html #:html-writer #:write-part)
|
9
|
10
|
(:export #:enable))
|
10
|
11
|
|
11
|
12
|
(in-package :coleslaw-rst)
|
12
|
13
|
|
13
|
14
|
(defmethod render-content (text (format (eql :rst)))
|
|
15
|
+ (register-settings-spec '((:generator nil)
|
|
16
|
+ (:datestamp nil)))
|
14
|
17
|
(with-output-to-string (str)
|
15
|
|
- (write-html str (read-rst text))))
|
|
18
|
+ (let ((writer (make-instance 'html-writer))
|
|
19
|
+ (document (read-rst text)))
|
|
20
|
+ (visit-node writer document)
|
|
21
|
+ (write-document writer document str))))
|
16
|
22
|
|
17
|
23
|
(defun enable ())
|