;; Load our local wiliki installation 
 (set! *load-path* 
       (cons "/home/csw/wiliki/src" 
 (use srfi-2) 
 (use util.list) 
 (use wiliki) 
 (use wiliki.format) 
 (use dbm.gdbm-ci) 
 (use wiliki.settings-css) 
 (use wiliki.settings-user-name) 
 (wiliki:register-settings-css '(("Default" "/css/default.css") 
                                 ("Plain" "/css/plain.css") 
                                 ("Empty" "/css/empty.css"))) 
 (define (csw-page-head-elements page opts) 
   `((title ,(ref page 'title)) 
         => (lambda (w) 
              `((base (@ (href ,((with-module wiliki full-script-path-of) 
                (link (@ (rel "alternate") 
                         (type "application/rss+xml") 
                         (title "RSS") 
                         (href ,(wiliki:self-url "c=rss"))))))) 
     ,(or (and-let* ((w (wiliki)) 
                     (ss (wiliki:settings-css-file (ref w 'style-sheet)))) 
            `(link (@ (rel "stylesheet") (href ,ss) (type "text/css")))) 
          ;; default 
          '(style (@ (type "text/css")) 
             "body { background-color: #eeeedd }")) 
 (define (csw-page-header page opts) 
   `(,@(wiliki:page-title page) 
     (div (@ (align "right")) 
             ((wiliki:top-link page)) 
             ((wiliki:recent-link page)) 
             ((wiliki:all-link page)) 
             ((wiliki:edit-link page)) 
             ((wiliki:history-link page))) 
 (define (csw-page-footer page opts) 
     (div (@ (class "footer") (style "text-align:right")) 
          "Last modified : " ,(wiliki:format-time (ref page 'mtime)) 
          (a (@ (href "")) 
             "WiLiKi " ,(wiliki:version)) 
          " running on " 
          (a (@ (href "")) 
             "Gauche ",(gauche-version))))) 
 (define (csw-time time) 
   (if time 
       (if (zero? time) 
           ($$ "Epoch") 
           ;; use UTC (GMT) time by default 
           (sys-strftime "%Y-%m-%d %T" (sys-gmtime time))) 
 (let ((formatter (wiliki:formatter))) 
   (set! (ref formatter 'head-elements) csw-page-head-elements) 
   (set! (ref formatter 'header) csw-page-header) 
   (set! (ref formatter 'footer) csw-page-footer) 
   (set! (ref formatter 'time) csw-time)) 
 (define (settings) 
   `(a (@ (href ,(wiliki:self-url "c=settings"))) 
 (define (howto) 
   `(a (@ (href ,(wiliki:self-url "wiki-howto"))) 
       "[Wiki Howto]")) 
 (define (category-link) 
   `(a (@ (href ,(wiliki:self-url "category-category"))) 
 (define (user-page-link) 
   (and-let* ((user-name (wiliki:settings-user-name #f))) 
     `(a (@ (href ,(wiliki:self-url user-name))) 
         "[" ,user-name "]"))) 
 (define (main args) 
    (make <wiliki> 
      :db-type <gdbm-ci> 
      :db-path "/home/csw/data/community.dbm" 
      :log-file "/home/csw/data/community.log" 
      :top-page "Community-Scheme-Wiki" 
      :title "Community Scheme Wiki" 
      :cookie-name "csw-settings" 
      :description "A wiki by the Scheme community for the Scheme community" 
      :style-sheet "/css/default.css" 
      :language 'en 
      :charsets '((en . utf-8) (jp . euc-jp)) 
      :image-urls '((#/.*/ allow)) 
      :scheme-keyword-page "scheme-keywords" 
      :interwikiname "inter-wiki-map" 
      :max-rc-size #f 
      :max-rc-age (* 10 24 60 60) ;; 10 days 
      :debug-level 0 
 ;; Local variables: 
 ;; mode: scheme 
 ;; end: