Changeset 15374 in project


Ignore:
Timestamp:
08/09/09 13:58:28 (10 years ago)
Author:
Ivan Raikov
Message:

created qwiki-sxml-page-template procedure

Location:
release/4/qwiki/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki-sxml.scm

    r15373 r15374  
    3737
    3838(module qwiki-sxml
     39
    3940  (qwiki-html-transformation-rules)
    4041
     
    7374                     Date-Revision-yyyymmdd Date-Creation-yyyymmdd))
    7475      (circular-list nl))
    75     ,nl
    76     (page-specific-links)))
     76    ,nl))
    7777
    7878(define qwiki-html-transformation-rules
  • release/4/qwiki/trunk/qwiki.scm

    r15373 r15374  
    6161;; The base URI for this wiki
    6262(define qwiki-base-uri (make-parameter "/" uri-reference))
    63 
     63 
    6464;; The rules used for rendering wiki pages (default is HTML)
    6565(define qwiki-output-driver
     
    7474                (qwiki-output-driver)
    7575                )))
     76
     77;; The basic template for SXML wiki pages
     78(define (qwiki-sxml-page-template contents . headers)
     79   `(wiki-page (Header ,@headers)
     80               (body (page-specific-links)
     81                     ,contents)))
    7682
    7783;; Return the trailing part of the path relative to the docroot/base-uri
     
    116122               (alist-ref 'rev (uri-query (request-uri req)) eq? "")))
    117123         (history (get-history source-file rev #f)) ; no pagination yet
    118          (content `(wiki-page (Header) (body (history ,history)))))
     124         (content (qwiki-sxml-page-template `(history ,history))))
    119125    (send-content content)))
    120126
     
    132138         ;; it can be extended by plugins.  The names of the buttons are
    133139         ;; pretty much tied to the code though
    134          (content `(wiki-page
    135                     (Header)
    136                     (body
     140         (content (qwiki-sxml-page-template
     141                   `(
    137142                     ,(if (alist-ref 'preview postdata)
    138143                          `(div (@ (class "preview"))
     
    179184        (if rev
    180185            (send-content ; Do not store if old rev
    181              `(wiki-page (Header)
    182                          (body
    183                           ,(call-with-input-revision
    184                             source-file rev wiki-parse))))
     186             (qwiki-sxml-page-template
     187              (call-with-input-revision
     188               source-file rev wiki-parse)))
    185189            (begin
    186190             (update-html-file! (make-pathname (root-path) html-file)
     
    199203    (with-output-to-path html-file
    200204      (lambda ()
    201         (let ((content `(wiki-page
    202                          (Header)
    203                          (body
    204                           ,(call-with-input-file source-file wiki-parse)))))
     205        (let ((content (qwiki-sxml-page-template
     206                        (call-with-input-file source-file wiki-parse))))
    205207          (output-xml content (qwiki-transformation-steps)))))))
    206208
     
    243245  (call-with-input-file file
    244246    (lambda (input)
    245       (let ((content `(wiki-page (Header) (body ,(wiki-parse input)))))
     247      (let ((content (qwiki-sxml-page-template (wiki-parse input))))
    246248        (output-xml content (qwiki-transformation-steps))))))
    247249
Note: See TracChangeset for help on using the changeset viewer.