Anonymous committed 5c67b65

Some naming normalization

  • Participants
  • Parent commits 3981871

Comments (0)

Files changed (1)

File ate-impl.scm

 (define pages
   (make-parameter '()))
-(define page-readers
+(define page-part-readers
    `(("md" . ,markdown->sxml))))
      (cons ((make-page-path) page name)
            (read-page-part page name)))))
-(define (read-page-part* reader file)
-  (with-input-from-file file reader))
-;; Reads a page part, 'content by default, and returns its SXML
-;; representation. There will be a parameter (page-readers) or
-;; something which is an alist of file extensions to reader
-;; procedures. Those are checked in order for presence and the first
-;; matching one is used.
 (define (read-page-part page #!optional (part 'content))
   (let ((part (make-pathname "" (symbol->string part) "part"))
         (dir  (pathname-directory (page-source-path page))))
-    (let loop ((readers (page-readers)))
+    (let loop ((readers (page-part-readers)))
       (if (null? readers)
           (error "Couldn't find page part" page part)
           (let ((file (make-pathname dir part (caar readers))))
             (if (file-exists? file)
-                (read-page-part* (cdar readers) file)
+                (with-input-from-file file (cdar readers))
                 (loop (cdr readers))))))))
 ;; The default page rendering function. A page rendering function must
 ;; return a list of pairs with the car being the target path and the
 ;; cdr being the SXML HTML representation of the page. By default it
 ;; renders the page's `content` part and wraps it in the `default`
-;; layout and uses the current `make-page-path` function to generate
+;; template and uses the current `make-page-path` function to generate
 ;; its name.
 (define default-content-renderer
   ;;(with-template (part 'content 'index) 'default)
 ;;          content: ((part 'content) page)
 ;;          attrs))
+;; Executes all renderers of a page as given in the `render:`
+;; attribute.
 (define (render-page page)
   (let ((renderers (page-attr page render:)))
     (when renderers