diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss index f4236ff7..40ec68a6 100644 --- a/collects/scribble/base-render.ss +++ b/collects/scribble/base-render.ss @@ -296,7 +296,9 @@ (let ([number (collected-info-number (part-collected-info part))]) (let ([subs (if (quiet (and (styled-part? part) - (eq? 'quiet (styled-part-style part)) + (let ([st(styled-part-style part)]) + (or (eq? 'quiet st) + (and (list? st) (memq 'quiet st)))) (not (= base-len (sub1 (length number)))))) (apply append diff --git a/collects/scribble/basic.ss b/collects/scribble/basic.ss index d3124678..8a60e165 100644 --- a/collects/scribble/basic.ss +++ b/collects/scribble/basic.ss @@ -22,17 +22,17 @@ (let ([content (decode-content str)]) (make-title-decl (or tag (gen-tag content)) style content))) - (define (section #:tag [tag #f] . str) + (define (section #:tag [tag #f] #:style [style #f] . str) (let ([content (decode-content str)]) - (make-part-start 0 (or tag (gen-tag content)) content))) + (make-part-start 0 (or tag (gen-tag content)) style content))) (define (subsection #:tag [tag #f] . str) (let ([content (decode-content str)]) - (make-part-start 1 (or tag (gen-tag content)) content))) + (make-part-start 1 (or tag (gen-tag content)) #f content))) (define (subsubsection #:tag [tag #f] . str) (let ([content (decode-content str)]) - (make-part-start 2 (or tag (gen-tag content)) content))) + (make-part-start 2 (or tag (gen-tag content)) #f content))) (define (subsubsub*section #:tag [tag #f] . str) (let ([content (decode-content str)]) diff --git a/collects/scribble/decode.ss b/collects/scribble/decode.ss index f81a9d11..a21c3ca4 100644 --- a/collects/scribble/decode.ss +++ b/collects/scribble/decode.ss @@ -18,6 +18,7 @@ [content list?])] [part-start ([depth integer?] [tag (or/c false/c string?)] + [style any/c] [title list?])] [splice ([run list?])] [part-index-decl ([plain-seq (listof string?)] @@ -136,10 +137,11 @@ ((part-start-depth (car l)) . <= . part-depth)) (part? (car l)))) (let ([para (decode-accum-para accum)] - [s (decode-part (reverse s-accum) - (part-start-tag s) - (part-start-title s) - (add1 part-depth))] + [s (decode-styled-part (reverse s-accum) + (part-start-tag s) + (part-start-style s) + (part-start-title s) + (add1 part-depth))] [part (decode-flow* l keys tag style title part-depth)]) (make-styled-part (part-tags part) (part-title-content part) @@ -179,6 +181,9 @@ (define (decode-part l tag title depth) (decode-flow* l null tag #f title depth)) + (define (decode-styled-part l tag style title depth) + (decode-flow* l null tag style title depth)) + (define (decode-flow l) (part-flow (decode-flow* l null #f #f #f #f))) diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index 8a4f256e..f9783ba4 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -454,7 +454,9 @@ (define/private (toc-part? d) (and (styled-part? d) - (eq? 'toc (styled-part-style d)))) + (let ([st (styled-part-style d)]) + (or (eq? 'toc st) + (and (list? st) (memq 'toc st)))))) (define/override (collect-part d parent ht number) (let ([prev-sub (collecting-sub)]) diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss index dc6eeec3..076bb0e3 100644 --- a/collects/scribble/manual.ss +++ b/collects/scribble/manual.ss @@ -84,10 +84,14 @@ #f (map (lambda (s) (list (make-flow (list (make-paragraph - (let ([spaces (cdar (regexp-match-positions #rx"^ *" s))]) - (list - (hspace spaces) - (make-element 'tt (list (substring s spaces)))))))))) + (let loop ([s s]) + (let ([spaces (regexp-match-positions #rx"(?:^| ) +" s)]) + (if spaces + (append + (loop (substring s 0 (caar spaces))) + (list (hspace (- (cdar spaces) (caar spaces)))) + (loop (substring s (cdar spaces)))) + (list (make-element 'tt (list s))))))))))) strs)))) (define-syntax indexed-scheme