Changeset 12885 in project


Ignore:
Timestamp:
12/26/08 16:45:48 (11 years ago)
Author:
azul
Message:

Surround sections (as described by == and family) with <div> ... </div> tags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/stream-wiki/trunk/stream-wiki.scm

    r12731 r12885  
    191191    (constantly stream-null)
    192192    ; header
    193     (constantly stream-null)
     193    (lambda (name depth id text)
     194      (stream-traverse text)
     195      stream-null)
    194196    ; blockquote
    195197    (compose (constantly stream-null) stream-traverse)
     
    250252    'open-document-format
    251253    (constantly (html-stream (hr)))
    252     (lambda (name depth id)
     254    (lambda (name depth id text)
    253255      (stream-append
    254256        (html-stream ((a name (text->html-id name))))
    255         (string->stream (format #f "<h~A>" (min 6 (+ depth header-start))))
     257        (string->stream (format #f "<div id='~A'><h~A>" (text->html-id name) (min 6 (+ depth header-start))))
    256258        name
    257         (string->stream (format #f "</h~A>" (min 6 (+ depth header-start))))))
     259        (string->stream (format #f "</h~A>" (min 6 (+ depth header-start))))
     260        text
     261        (string->stream "</div>")))
    258262    (tags-func blockquote)
    259263    (tags-func center)
     
    298302(define (make-html-header . rest)
    299303  (let-optionals rest ((header-start 1))
    300     (lambda (name depth id)
     304    (lambda (name depth id text)
    301305      (html-stream
    302306        ((a name (text->html-id id)))
    303307        (string->stream (format #f "<h~A>" (min 6 (+ depth header-start))))
    304308        name
    305         (string->stream (format #f "</h~A>" (min 6 (+ depth header-start))))))))
     309        (string->stream (format #f "</h~A>" (min 6 (+ depth header-start))))
     310        text))))
    306311
    307312(define (html-driver-link check-exists? url-adjust no-follow? dst name)
     
    466471      (constantly stream-null))
    467472    ; make header
    468     (lambda (name depth id)
    469       (stream-append name (stream #\newline #\newline)))
     473    (lambda (name depth id text)
     474      (stream-append name (stream #\newline #\newline) text))
    470475    ; blockquote
    471476    (if human-readable
     
    573578(define (links-driver register)
    574579  (make-driver
     580    ; format
    575581    'links
    576     (constantly stream-null)
    577     (constantly stream-null)
     582    ; horizontal-line
     583    (constantly stream-null)
     584    ; header
     585    (lambda (name depth id text)
     586      (stream-traverse text)
     587      stream-null)
    578588    (compose (constantly stream-null) stream-traverse)
    579589    (compose (constantly stream-null) stream-traverse)
     
    613623(define (tags-driver register)
    614624  (make-driver
     625    ; format
    615626    'tags
    616     (constantly stream-null)
    617     (constantly stream-null)
     627    ; horizontal-line
     628    (constantly stream-null)
     629    ; header
     630    (lambda (name depth id text)
     631      (stream-traverse text)
     632      stream-null)
    618633    (compose (constantly stream-null) stream-traverse)
    619634    (compose (constantly stream-null) stream-traverse)
     
    696711(define (latex-driver class links-base . rest)
    697712  (let-optionals rest ((include-in-toc (list 0 1 2 3 4))
    698                        (newpage-after-section (list))
    699                        )
     713                       (newpage-after-section (list)))
    700714  (make-driver
    701715    'latex
     
    704718    ; make header
    705719    (let ((add (if (or (string=? class "book") (string=? class "report")) 0 1)))
    706       (lambda (name depth id)
     720      (lambda (name depth id text)
    707721        (stream-append
    708722          (let ((real-depth (+ depth add)))
     
    720734                (string->stream "\\noindent \\textbf{"))))
    721735          (latex-text-parse name)
    722           (stream #\} #\newline #\newline))))
     736          (stream #\} #\newline #\newline)
     737          text)))
    723738    ; blockquote
    724739    (latex-environment 'quote)
     
    11441159        (all char-blank?)
    11451160        (? #\= depth (all char-blank?))
    1146         (or #\newline ((end))))
     1161        (or #\newline ((end)))
     1162        (bind text
     1163              (all (or ((or (#\= depth #\=)
     1164                            ((? (not #\newline)) (not (or #\= #\newline))))
     1165                        (all (not #\newline)))
     1166                       #\newline))))
    11471167       (wikidata-header
    11481168         info
     
    11521172           (text-transform info #f #f #f #f #\space))
    11531173         (min 5 (stream-length (stream-cdr depth)))
    1154          (sections-accept-new-name! (wikidata-previous-sections info) name)))
     1174         (sections-accept-new-name! (wikidata-previous-sections info) name)
     1175         (parse-all
     1176           text
     1177           (lambda () (error "noparse" (stream->string text)))
     1178           (global-token-info info))))
    11551179
    11561180      ; Skip empty lines:
     
    16801704     (constantly stream-null)
    16811705     ;; make header
    1682      (lambda (name depth id)
     1706     (lambda (name depth id text)
    16831707       (let ((up-node (and (positive? depth) (vector-ref last-at-depth (- depth 1)))))
    16841708         (stream-append
     
    16981722               (call-with-output-string
    16991723                (lambda (out) (print-node node out prologue))))))
    1700           (stream #\newline #\newline))))
     1724          (stream #\newline #\newline)
     1725          text)))
    17011726     ;; blockquote
    17021727     (texi-wrap "@quotation\n" "\n@end quotation\n")
     
    18681893       (constantly stream-null)
    18691894       ;; make header
    1870        (lambda (name depth id)
     1895       (lambda (name depth id text)
    18711896         (let* ((up-node    (and (positive? depth) (vector-ref last-at-depth (- depth 1))))
    18721897                (sym        (string->symbol (escape-texi-node-name (stream->string name) up-node)))
     
    18961921             (vector-set! last-at-depth depth this-node)
    18971922             (vector-set! last-at-depth (+ depth 1) #f)
    1898              stream-null)))
     1923             text)))
    18991924
    19001925       ;; blockquote
Note: See TracChangeset for help on using the changeset viewer.