浏览代码

Rename render-content to render-text for clarity. Retroactively add to 0.9.3.

Brit Butler 11 年之前
父节点
当前提交
5e9a256a91
共有 6 个文件被更改,包括 8 次插入7 次删除
  1. 1 0
      NEWS.md
  2. 1 1
      docs/plugin-api.md
  3. 2 2
      plugins/rst.lisp
  4. 2 2
      src/coleslaw.lisp
  5. 1 1
      src/packages.lisp
  6. 1 1
      src/posts.lisp

+ 1 - 0
NEWS.md

1
 ## Changes for 0.9.3 (2013-04-16):
1
 ## Changes for 0.9.3 (2013-04-16):
2
 
2
 
3
 * **INCOMPATIBLE CHANGE**: `page-path` and the `blog` config class are no longer exported.
3
 * **INCOMPATIBLE CHANGE**: `page-path` and the `blog` config class are no longer exported.
4
+* **INCOMPATIBLE CHANGE**: `render-content` has been renamed `render-text` for clarity.
4
 * New Docs: [A Hacker's Guide to Coleslaw](hacking_guide) and [Themes](theming_guide)!
5
 * New Docs: [A Hacker's Guide to Coleslaw](hacking_guide) and [Themes](theming_guide)!
5
 * A new theme *readable* based on bootswatch readable, courtesy of @rmoritz!
6
 * A new theme *readable* based on bootswatch readable, courtesy of @rmoritz!
6
 * Posts may have an author to support multi-user blogs courtesy of @tychoish.
7
 * Posts may have an author to support multi-user blogs courtesy of @tychoish.

+ 1 - 1
docs/plugin-api.md

28
 
28
 
29
 * **New markup formats**, for example the
29
 * **New markup formats**, for example the
30
   [ReStructuredText plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/rst.lisp),
30
   [ReStructuredText plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/rst.lisp),
31
-  can be created by definining an appropriate `render-content`
31
+  can be created by definining an appropriate `render-text`
32
   method. The method takes `text` and `format` arguments and is
32
   method. The method takes `text` and `format` arguments and is
33
   [EQL-specialized](http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html#defmethod)
33
   [EQL-specialized](http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html#defmethod)
34
   on the format. Format should be a keyword matching the file
34
   on the format. Format should be a keyword matching the file

+ 2 - 2
plugins/rst.lisp

3
 
3
 
4
 (defpackage :coleslaw-rst
4
 (defpackage :coleslaw-rst
5
   (:use :cl)
5
   (:use :cl)
6
-  (:import-from :coleslaw #:render-content)
6
+  (:import-from :coleslaw #:render-text)
7
   (:import-from :docutils #:read-rst #:write-part #:register-settings-spec
7
   (:import-from :docutils #:read-rst #:write-part #:register-settings-spec
8
                           #:visit-node #:write-document)
8
                           #:visit-node #:write-document)
9
   (:import-from :docutils.writer.html #:html-writer #:write-part)
9
   (:import-from :docutils.writer.html #:html-writer #:write-part)
11
 
11
 
12
 (in-package :coleslaw-rst)
12
 (in-package :coleslaw-rst)
13
 
13
 
14
-(defmethod render-content (text (format (eql :rst)))
14
+(defmethod render-text (text (format (eql :rst)))
15
   (register-settings-spec '((:generator nil)
15
   (register-settings-spec '((:generator nil)
16
                             (:datestamp nil)))
16
                             (:datestamp nil)))
17
   (with-output-to-string (str)
17
   (with-output-to-string (str)

+ 2 - 2
src/coleslaw.lisp

58
            (content (construct content-type (read-content file))))
58
            (content (construct content-type (read-content file))))
59
       (write-page "tmp.html" (render-page content)))))
59
       (write-page "tmp.html" (render-page content)))))
60
 
60
 
61
-(defgeneric render-content (text format)
62
-  (:documentation "Compile TEXT from the given FORMAT to HTML for display.")
61
+(defgeneric render-text (text format)
62
+  (:documentation "Render TEXT of the given FORMAT to HTML for display.")
63
   (:method (text (format (eql :html)))
63
   (:method (text (format (eql :html)))
64
     text)
64
     text)
65
   (:method (text (format (eql :md)))
65
   (:method (text (format (eql :md)))

+ 1 - 1
src/packages.lisp

13
            #:content
13
            #:content
14
            #:post
14
            #:post
15
            #:index
15
            #:index
16
-           #:render-content
16
+           #:render-text
17
            #:add-injection
17
            #:add-injection
18
            ;; The Document Protocol
18
            ;; The Document Protocol
19
            #:add-document
19
            #:add-document

+ 1 - 1
src/posts.lisp

12
                    (text content-text)) object
12
                    (text content-text)) object
13
       (setf (content-slug object) (slugify title)
13
       (setf (content-slug object) (slugify title)
14
             format (make-keyword (string-upcase format))
14
             format (make-keyword (string-upcase format))
15
-            text (render-content text format)
15
+            text (render-text text format)
16
             author (or author (author *config*)))))
16
             author (or author (author *config*)))))
17
 
17
 
18
 (defmethod render ((object post) &key prev next)
18
 (defmethod render ((object post) &key prev next)