Changeset 13669 in project


Ignore:
Timestamp:
03/10/09 16:16:35 (11 years ago)
Author:
felix winkelmann
Message:

manual fixes

Location:
chicken/trunk
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • chicken/trunk/manual/Basic mode of operation

    r11013 r13669  
    5555
    5656Previous: [[The User's Manual]]
     57
    5758Next: [[Using the compiler]]
  • chicken/trunk/manual/Getting started

    r13646 r13669  
    3838a working knowledge of Scheme.
    3939
    40 ----
     40Next: [[Using the compiler]]
     41
    4142Back to [[The User's Manual]]
  • chicken/trunk/scripts/wiki2html.scm

    r13661 r13669  
    2727(define +header+ '(: (submatch (>= 2 #\=)) (* space) (submatch (* any))))
    2828(define +pre+ '(: (>= 1 space) (submatch (* any))))
    29 (define +d-list+ '(: (* space) #\; (submatch (~ #\:)) #\: (submatch (* any))))
     29(define +d-list+ '(: (* space) #\; (submatch (* (~ #\:))) #\: (submatch (* any))))
    3030(define +u-list+ '(: (* space) (submatch (>= 1 #\*)) (* space) (submatch (* any))))
    3131(define +o-list+ '(: (* space) (submatch (>= 1 #\*)) #\# (* space) (submatch (* any))))
    3232(define +hr+ '(: (* space) (submatch (>= 3 #\-)) (* space)))
    33 (define +emptyline+ '(: bos (* space) eos))
    3433
    3534(define +block-element+
     
    8180       (let ((ln (read-line in)))
    8281         (cond ((eof-object? ln) (return #f))
    83                ((string-match (rx +emptyline+) ln)
    84                 (fprintf out "~%"))
    8582               ((not (string-match (rx +block-element+) ln))
    86                 (pop-all out)
    87                 (fprintf out "~a~%" (inline ln)))
     83                (cond ((string-null? ln) (display "<br />\n" out))
     84                      (else
     85                       (pop-all out)
     86                       (fprintf out "~a~%" (inline ln)))))
    8887               ((string-match (rx +header+) ln) =>
    8988                (lambda (m)
     
    9695                (lambda (m)
    9796                  (push-tag 'pre out)
    98                   (display (clean (car m)))))
     97                  (fprintf out "~a~%" (clean (car m)))))
    9998               ((string-match (rx +hr+) ln) =>
    10099                (lambda (m)
     
    145144                             ((member m1 *manual-pages*)
    146145                              (string-append
    147                                "<a href='" m1 ".html'>" m1 "</a>"))
     146                               "<a href='" (clean m1) ".html'>" (clean m1) "</a>"))
    148147                             (else
    149148                              (string-append
     
    170169      (match n
    171170        (('*PI* . _) "")
    172         (('*TOP* . n) n)
    173171        (('enscript strs ...)
    174          `(pre ,@strs))
     172         `(pre ,@(match strs
     173                   ((('@ . _) . strs) strs)
     174                   (_ strs))))
    175175        (('procedure strs ...)
    176176         `(pre "\n [procedure] " ,@strs))
     177        (((? symbol? tag) ('@ attr ...) . body)
     178         `(,tag (@ ,@attr) ,@(map walk body)))
    177179        (((? symbol? tag) . body)
    178180         `(,tag ,@(map walk body)))
     
    180182    (display
    181183     (shtml->html
    182       (wrap name (walk sxml))))))
     184      (wrap name (walk `(body ,@(cdr sxml))))))))
    183185
    184186(define (wrap name body)
    185187  `(html (head (title ,(string-append "The CHICKEN User's Manual - " name)))
    186          (body ,@body)))
     188         ,body))
    187189
    188190
     
    190192
    191193(define (clean str)
    192   (string-translate* str '(("<" . "&lt;") ("&" . "&amp;") ("'" . "&rsquo;"))))
     194  (string-translate* str '(("<" . "&lt;") ("&" . "&amp;") ("'" . "&apos;") ("\"" . "&quot;"))))
    193195
    194196
Note: See TracChangeset for help on using the changeset viewer.