Changeset 15383 in project


Ignore:
Timestamp:
08/10/09 02:46:54 (10 years ago)
Author:
Ivan Raikov
Message:

added table of contents functionality to qwiki

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

Legend:

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

    r15375 r15383  
    7676    ,nl))
    7777
    78 (define qwiki-html-transformation-rules
     78(define (qwiki-html-transformation-rules content)
    7979
    8080  `(
     
    100100          `((n_) (a (@ (name ,head-word)) (n_))
    101101            (,(string->symbol (string-append "h" (number->string level)))
    102              ,head-word ,elems))))
    103 
    104 #|    TODO: figure out how to pass the content for rescanning
     102             ,head-word ,elems) ,nl
     103            )))
    105104
    106105    (TOC        ;; Re-scan the content for "Section" tags and generate
    107106     . ,(lambda (tag . rest)    ;; the table of contents
    108107          (let ((sections
    109                  (pre-post-order Content
     108                 (pre-post-order content
    110109                                 `(
    111110                                   (Section     ;; (Section level "content ...")
     
    123122                  sections
    124123                  "</ul></div>" nl))))
    125 |#
    126     (TOC . ,(lambda (tag rest) (list)))
    127124
    128125    (special
  • release/4/qwiki/trunk/qwiki.scm

    r15375 r15383  
    7171
    7272;; The rules used for transforming page SXML structure
    73 (define (qwiki-transformation-steps)
     73(define (qwiki-transformation-steps content)
    7474  (list (append (qwiki-extensions)
    75                 (qwiki-output-driver)
     75                ((qwiki-output-driver) content)
    7676                )))
    7777
     
    112112  (with-output-to-port (response-port (current-response))
    113113    (lambda ()
    114       (output-xml content (qwiki-transformation-steps))))
     114      (output-xml content (qwiki-transformation-steps content))))
    115115  (close-output-port (response-port (current-response))))
    116116
     
    206206        (let ((content (qwiki-sxml-page-template
    207207                        (call-with-input-file source-file wiki-parse))))
    208           (output-xml content (qwiki-transformation-steps)))))))
     208          (output-xml content (qwiki-transformation-steps content)))))))
    209209
    210210;;; Request dispatching
     
    247247    (lambda (input)
    248248      (let ((content (qwiki-sxml-page-template (wiki-parse input))))
    249         (output-xml content (qwiki-transformation-steps))))))
     249        (output-xml content (qwiki-transformation-steps content))))))
    250250
    251251)
Note: See TracChangeset for help on using the changeset viewer.