Anonymous avatar Anonymous committed 5c67b65

Some naming normalization

Comments (0)

Files changed (1)

 (define pages
   (make-parameter '()))
 
-(define page-readers
+(define page-part-readers
   (make-parameter
    `(("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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.