doc work (start on module guide)

svn: r6730

original commit: f7bf029234e0d3ce26e4200094b1986f5f538689
This commit is contained in:
Matthew Flatt 2007-06-25 06:37:25 +00:00
parent 9595675a5c
commit 4c40ffdd26
5 changed files with 52 additions and 32 deletions

View File

@ -326,7 +326,7 @@
fns))) fns)))
(define/override (part-whole-page? d) (define/override (part-whole-page? d)
(= 2 (collecting-sub))) ((collecting-sub) . <= . 2))
(define/private (toc-part? d) (define/private (toc-part? d)
(and (styled-part? d) (and (styled-part? d)

View File

@ -50,6 +50,7 @@
(define-color "schemeresult" "ResultColor") (define-color "schemeresult" "ResultColor")
(define-color "schemestdout" "OutputColor") (define-color "schemestdout" "OutputColor")
(define-color "schememeta" "IdentifierColor") (define-color "schememeta" "IdentifierColor")
(define-color "schememod" "black")
(define-color "schemevariablecol" "IdentifierColor") (define-color "schemevariablecol" "IdentifierColor")
(printf "\\newcommand{\\schemevariable}[1]{{\\schemevariablecol{\\textsl{#1}}}}\n") (printf "\\newcommand{\\schemevariable}[1]{{\\schemevariablecol{\\textsl{#1}}}}\n")
(define-color "schemeerrorcol" "red") (define-color "schemeerrorcol" "red")
@ -232,6 +233,7 @@
[(ldquo) "``"] [(ldquo) "``"]
[(rdquo) "''"] [(rdquo) "''"]
[(rsquo) "'"] [(rsquo) "'"]
[(prime) "$'$"]
[(rarr) "$\\rightarrow$"]))] [(rarr) "$\\rightarrow$"]))]
[else (display-protected (format "~s" i))]) [else (display-protected (format "~s" i))])
null) null)

View File

@ -94,7 +94,7 @@
(provide onscreen menuitem defterm (provide onscreen menuitem defterm
schemefont schemevalfont schemeresultfont schemeidfont schemefont schemevalfont schemeresultfont schemeidfont
schemeparenfont schemekeywordfont schememetafont schemeparenfont schemekeywordfont schememetafont schememodfont
file exec file exec
link procedure link procedure
idefterm) idefterm)
@ -120,6 +120,8 @@
(make-element "schemeparen" (decode-content str))) (make-element "schemeparen" (decode-content str)))
(define (schememetafont . str) (define (schememetafont . str)
(make-element "schememeta" (decode-content str))) (make-element "schememeta" (decode-content str)))
(define (schememodfont . str)
(make-element "schememod" (decode-content str)))
(define (schemekeywordfont . str) (define (schemekeywordfont . str)
(make-element "schemekeyword" (decode-content str))) (make-element "schemekeyword" (decode-content str)))
(define (file . str) (define (file . str)
@ -808,12 +810,15 @@
(let loop ([i i]) (let loop ([i i])
(cond (cond
[(string? i) [(string? i)
(let ([m (regexp-match #rx"^(.*)([()])(.*)$" i)]) (cond
(if m [(regexp-match #rx"^(.*)([()])(.*)$" i)
(append (loop (cadr m)) => (lambda (m)
(list (caddr m)) (append (loop (cadr m))
(loop (cadddr m))) (list (caddr m))
(list (make-element 'italic (list i)))))] (loop (cadddr m))))]
[else
(list (make-element 'italic (list i)))])]
[(eq? i 'rsquo) (list 'prime)]
[else (list i)]))) [else (list i)])))
c))))) c)))))

View File

@ -49,6 +49,8 @@
(define-struct (sized-element element) (length)) (define-struct (sized-element element) (length))
(define-struct spaces (pre cnt post))
(define (typeset c multi-line? prefix1 prefix suffix color?) (define (typeset c multi-line? prefix1 prefix suffix color?)
(let* ([c (syntax-ize c 0)] (let* ([c (syntax-ize c 0)]
[content null] [content null]
@ -78,26 +80,35 @@
[(and (element? v) [(and (element? v)
(= 1 (length (element-content v)))) (= 1 (length (element-content v))))
(sz-loop (car (element-content v)))] (sz-loop (car (element-content v)))]
[(spaces? v)
(+ (sz-loop (spaces-pre v))
(spaces-cnt v)
(sz-loop (spaces-post v)))]
[else 1])))] [else 1])))]
[(v cls len) [(v cls len)
(unless (equal? v "") (unless (equal? v "")
(if (equal? v "\n") (cond
(if multi-line? [(spaces? v)
(begin (out (spaces-pre v) cls 0)
(finish-line!) (out (make-element 'hspace (list (make-string (spaces-cnt v) #\space))) #f 0)
(out prefix cls)) (out (spaces-post v) cls len)]
(out " " cls)) [(equal? v "\n")
(begin (if multi-line?
(set! content (cons ((if highlight? (begin
(lambda (c) (finish-line!)
(make-element "highlighted" (list c))) (out prefix cls))
values) (out " " cls))]
(if color? [else
(make-element cls (list v)) (set! content (cons ((if highlight?
(make-element #f (list v)))) (lambda (c)
content)) (make-element "highlighted" (list c)))
(set! dest-col (+ dest-col len)))))])) values)
(define advance (if color?
(make-element cls (list v))
(make-element #f (list v))))
content))
(set! dest-col (+ dest-col len))]))]))
(define advance
(case-lambda (case-lambda
[(c init-line! delta) [(c init-line! delta)
(let ([c (+ delta (syntax-column c))] (let ([c (+ delta (syntax-column c))]
@ -168,12 +179,9 @@
(define (literalize-spaces i) (define (literalize-spaces i)
(let ([m (regexp-match-positions #rx" +" i)]) (let ([m (regexp-match-positions #rx" +" i)])
(if m (if m
(make-element (make-spaces (literalize-spaces (substring i 0 (caar m)))
#f (- (cdar m) (caar m))
(list (literalize-spaces (substring i 0 (caar m))) (literalize-spaces (substring i (cdar m))))
(make-element 'hspace
(list (substring i (caar m) (cdar m))))
(literalize-spaces (substring i (cdar m)))))
i))) i)))
(define (loop init-line! quote-depth) (define (loop init-line! quote-depth)
(lambda (c) (lambda (c)

View File

@ -41,7 +41,7 @@
width: 10em; width: 10em;
margin-right: 2em; margin-right: 2em;
text-align: left; text-align: left;
background-color: #ddffdd; background-color: #F5F5DC;
} }
.tocviewtitle { .tocviewtitle {
@ -237,6 +237,11 @@
font-family: Courier; font-size: 80%; font-family: Courier; font-size: 80%;
} }
.schememod {
color: black;
font-family: Courier; font-size: 80%;
}
.schemeopt { .schemeopt {
color: black; color: black;
} }