change scribble 'variant' to 'property'; add contracts in scribble/decode

svn: r15581
This commit is contained in:
Matthew Flatt 2009-07-27 03:55:43 +00:00
parent f651240503
commit 229e2636de
32 changed files with 326 additions and 278 deletions

View File

@ -74,7 +74,7 @@
(for/list ([k (in-hash-keys ht)]) (main-collects-relative->path k)))) (for/list ([k (in-hash-keys ht)]) (main-collects-relative->path k))))
(define/private (extract-style-style-files s ht pred extract) (define/private (extract-style-style-files s ht pred extract)
(for ([v (in-list (style-variants s))]) (for ([v (in-list (style-properties s))])
(when (pred v) (when (pred v)
(hash-set! ht (extract v) #t)))) (hash-set! ht (extract v) #t))))
@ -132,7 +132,7 @@
(or (ormap (lambda (v) (or (ormap (lambda (v)
(and (document-version? v) (and (document-version? v)
(document-version-text v))) (document-version-text v)))
(style-variants (part-style d))) (style-properties (part-style d)))
"")) ""))
(define/private (extract-pre-paras d sym) (define/private (extract-pre-paras d sym)
@ -464,7 +464,7 @@
(unless prefix-file (unless prefix-file
(for ([d (in-list ds)]) (for ([d (in-list ds)])
(let ([extras (ormap (lambda (v) (and (auto-extra-files? v) v)) (let ([extras (ormap (lambda (v) (and (auto-extra-files? v) v))
(style-variants (part-style d)))]) (style-properties (part-style d)))])
(when extras (when extras
(for ([fn (in-list (auto-extra-files-paths extras))]) (for ([fn (in-list (auto-extra-files-paths extras))])
(install-file (main-collects-relative->path fn)))))))) (install-file (main-collects-relative->path fn))))))))
@ -531,7 +531,7 @@
(define/public (render-block p part ri starting-item?) (define/public (render-block p part ri starting-item?)
(cond (cond
[(table? p) (if (memq 'aux (style-variants (table-style p))) [(table? p) (if (memq 'aux (style-properties (table-style p)))
(render-auxiliary-table p part ri) (render-auxiliary-table p part ri)
(render-table p part ri starting-item?))] (render-table p part ri starting-item?))]
[(itemization? p) (render-itemization p part ri)] [(itemization? p) (render-itemization p part ri)]

View File

@ -4,7 +4,7 @@
"core.ss" "core.ss"
"manual-struct.ss" "manual-struct.ss"
"decode-struct.ss" "decode-struct.ss"
"html-variants.ss" "html-properties.ss"
scheme/list scheme/list
scheme/class scheme/class
scheme/contract scheme/contract
@ -501,7 +501,7 @@
style) style)
(cons (make-target-url url) (cons (make-target-url url)
(if (style? style) (if (style? style)
(style-variants style) (style-properties style)
null))) null)))
(decode-content str))) (decode-content str)))

View File

@ -169,12 +169,12 @@
[contents (listof content?)])] [contents (listof content?)])]
[style ([name (or/c string? symbol? #f)] [style ([name (or/c string? symbol? #f)]
[variants list?])] [properties list?])]
;; variants: ;; properties:
[document-version ([text (or/c string? false/c)])] [document-version ([text (or/c string? false/c)])]
[target-url ([addr path-string?])] [target-url ([addr path-string?])]
[color-variant ([color (or/c string? (list/c byte? byte? byte?))])] [color-property ([color (or/c string? (list/c byte? byte? byte?))])]
[background-color-variant ([color (or/c string? (list/c byte? byte? byte?))])] [background-color-property ([color (or/c string? (list/c byte? byte? byte?))])]
[table-columns ([styles (listof style?)])] [table-columns ([styles (listof style?)])]
[table-cells ([styless (listof (listof style?))])] [table-cells ([styless (listof (listof style?))])]
@ -455,7 +455,7 @@
(and (element? e) (and (element? e)
(let ([s (element-style e)]) (let ([s (element-style e)])
(and (style? e) (and (style? e)
(memq 'aux (style-variants s)))))) (memq 'aux (style-properties s))))))
(define (strip-aux content) (define (strip-aux content)
(cond (cond

View File

@ -6,19 +6,6 @@
scheme/class scheme/class
scheme/list) scheme/list)
(provide decode
decode-part
decode-flow
decode-paragraph
decode-compound-paragraph
decode-content
(rename-out [decode-content decode-elements])
decode-string
whitespace?
clean-up-index-string
pre-content?
pre-flow?)
(define (pre-content? i) (define (pre-content? i)
(or (string? i) (or (string? i)
(and (content? i) (and (content? i)
@ -34,6 +21,17 @@
(and (splice? i) (and (splice? i)
(andmap pre-flow? (splice-run i))))) (andmap pre-flow? (splice-run i)))))
(define (pre-part? v)
(or (pre-flow? v)
(title-decl? v)
(part-start? v)
(part-index-decl? v)
(part-collect-decl? v)
(part-tag-decl? v)
(part? v)
(and (splice? v)
(andmap pre-part? (splice-run v)))))
(provide-structs (provide-structs
[title-decl ([tag-prefix (or/c false/c string?)] [title-decl ([tag-prefix (or/c false/c string?)]
[tags (listof tag?)] [tags (listof tag?)]
@ -51,6 +49,33 @@
[part-collect-decl ([element (or/c element? part-relative-element?)])] [part-collect-decl ([element (or/c element? part-relative-element?)])]
[part-tag-decl ([tag tag?])]) [part-tag-decl ([tag tag?])])
(provide whitespace?
pre-content?
pre-flow?
pre-part?)
(provide/contract
[decode (-> (listof pre-part?)
part?)]
[decode-part (-> (listof pre-part?)
(listof string?)
(or/c #f content?)
exact-nonnegative-integer?
part?)]
[decode-flow (-> (listof pre-flow?)
(listof block?))]
[decode-paragraph (-> (listof pre-content?)
paragraph?)]
[decode-compound-paragraph (-> (listof pre-flow?)
paragraph?)]
[decode-content (-> (listof pre-content?)
content?)]
[rename decode-content decode-elements
(-> (listof pre-content?)
content?)]
[decode-string (-> string? content?)]
[clean-up-index-string (-> string? string?)])
(define (clean-up-index-string s) (define (clean-up-index-string s)
;; Collapse whitespace, and remove leading or trailing spaces, which ;; Collapse whitespace, and remove leading or trailing spaces, which
;; might appear there due to images or something else that gets ;; might appear there due to images or something else that gets
@ -102,7 +127,7 @@
(if vers (if vers
(make-style (style-name style) (make-style (style-name style)
(cons (make-document-version vers) (cons (make-document-version vers)
(style-variants style))) (style-properties style)))
style) style)
(let ([l (append (let ([l (append
(map (lambda (k tag) (map (lambda (k tag)
@ -113,7 +138,7 @@
keys k-tags) keys k-tags)
colls)]) colls)])
(if (and title (if (and title
(not (memq 'hidden (style-variants style)))) (not (memq 'hidden (style-properties style))))
(cons (make-index-element (cons (make-index-element
#f null (car tags) #f null (car tags)
(list (clean-up-index-string (list (clean-up-index-string

View File

@ -4,9 +4,9 @@
(provide-structs (provide-structs
[body-id ([value string?])] [body-id ([value string?])]
[hover-variant ([text string?])] [hover-property ([text string?])]
[script-variant ([type string?] [script-property ([type string?]
[script (or/c path-string? (listof string?))])] [script (or/c path-string? (listof string?))])]
[css-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)))])] [css-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)))])]
[html-defaults ([prefix-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] [html-defaults ([prefix-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))]
[style-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] [style-path (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))]

View File

@ -2,7 +2,7 @@
(require "core.ss" (require "core.ss"
"private/render-utils.ss" "private/render-utils.ss"
"html-variants.ss" "html-properties.ss"
scheme/class scheme/class
scheme/path scheme/path
scheme/file scheme/file
@ -132,14 +132,14 @@
(cond (cond
[(attributes? v) [(attributes? v)
(map (lambda (v) (list (car v) (cdr v))) (attributes-assoc v))] (map (lambda (v) (list (car v) (cdr v))) (attributes-assoc v))]
[(color-variant? v) [(color-property? v)
`((style ,(format "color: ~a" (color->string (color-variant-color v)))))] `((style ,(format "color: ~a" (color->string (color-property-color v)))))]
[(background-color-variant? v) [(background-color-property? v)
`((style ,(format "background-color: ~a" (color->string (background-color-variant-color v)))))] `((style ,(format "background-color: ~a" (color->string (background-color-property-color v)))))]
[(hover-variant? v) [(hover-property? v)
`((title ,(hover-variant-text v)))] `((title ,(hover-property-text v)))]
[else null])) [else null]))
(style-variants style)))]) (style-properties style)))])
(let ([name (style-name style)]) (let ([name (style-name style)])
(if (string? name) (if (string? name)
(cons `[class ,name] (cons `[class ,name]
@ -432,7 +432,7 @@
(filter (lambda (e) (filter (lambda (e)
(let loop ([e e]) (let loop ([e e])
(or (and (table? e) (or (and (table? e)
(memq 'aux (style-variants (table-style e))) (memq 'aux (style-properties (table-style e)))
(pair? (table-blockss e))) (pair? (table-blockss e)))
(and (delayed-block? e) (and (delayed-block? e)
(loop (delayed-block-blocks e ri)))))) (loop (delayed-block-blocks e ri))))))
@ -539,14 +539,14 @@
(or (ormap (lambda (v) (or (ormap (lambda (v)
(and (body-id? v) (and (body-id? v)
(body-id-value v))) (body-id-value v)))
(style-variants (part-style d))) (style-properties (part-style d)))
(let ([p (part-parent d ri)]) (let ([p (part-parent d ri)])
(and p (extract-part-body-id p ri))))) (and p (extract-part-body-id p ri)))))
(define/public (render-one-part d ri fn number) (define/public (render-one-part d ri fn number)
(parameterize ([current-output-file fn]) (parameterize ([current-output-file fn])
(let* ([defaults (ormap (lambda (v) (and (html-defaults? v) v)) (let* ([defaults (ormap (lambda (v) (and (html-defaults? v) v))
(style-variants (part-style d)))] (style-properties (part-style d)))]
[prefix-file (or prefix-file [prefix-file (or prefix-file
(and defaults (and defaults
(let ([v (html-defaults-prefix-path defaults)]) (let ([v (html-defaults-prefix-path defaults)])
@ -857,7 +857,7 @@
(not (style-name style)) (not (style-name style))
(null? attrs)) (null? attrs))
contents contents
`((,(if (memq 'div (style-variants style)) 'div 'p) `((,(if (memq 'div (style-properties style)) 'div 'p)
[,@attrs [,@attrs
,@(case (style-name style) ,@(case (style-name style)
[(author) '([class "author"])] [(author) '([class "author"])]
@ -919,15 +919,15 @@
,@sz ,@sz
,@(attribs)))))] ,@(attribs)))))]
[(and (or (element? e) (multiarg-element? e)) [(and (or (element? e) (multiarg-element? e))
(ormap (lambda (v) (and (script-variant? v) v)) (ormap (lambda (v) (and (script-property? v) v))
(let ([s (if (element? e) (let ([s (if (element? e)
(element-style e) (element-style e)
(multiarg-element-style e))]) (multiarg-element-style e))])
(if (style? s) (style-variants s) null)))) (if (style? s) (style-properties s) null))))
=> =>
(lambda (v) (lambda (v)
(let* ([t `[type ,(script-variant-type v)]] (let* ([t `[type ,(script-property-type v)]]
[s (script-variant-script v)] [s (script-property-script v)]
[s (if (list? s) [s (if (list? s)
`(script (,t ,@(attribs)) ,(apply as-literal `("\n" ,@s "\n"))) `(script (,t ,@(attribs)) ,(apply as-literal `("\n" ,@s "\n")))
`(script (,t ,@(attribs) [src ,s])))]) `(script (,t ,@(attribs) [src ,s])))])
@ -1002,20 +1002,20 @@
(define/private (render-plain-content e part ri) (define/private (render-plain-content e part ri)
(define (attribs) (content-attribs e)) (define (attribs) (content-attribs e))
(let* ([variants (let ([s (content-style e)]) (let* ([properties (let ([s (content-style e)])
(if (style? s) (if (style? s)
(style-variants s) (style-properties s)
null))] null))]
[name (let ([s (content-style e)]) [name (let ([s (content-style e)])
(if (style? s) (if (style? s)
(style-name s) (style-name s)
s))] s))]
[link? (and (ormap target-url? variants) [link? (and (ormap target-url? properties)
(not (current-no-links)))] (not (current-no-links)))]
[anchor? (ormap url-anchor? variants)] [anchor? (ormap url-anchor? properties)]
[attribs [attribs
(append (append
(if (null? variants) (if (null? properties)
null null
(append-map (lambda (v) (append-map (lambda (v)
(cond (cond
@ -1027,7 +1027,7 @@
(from-root addr (get-dest-directory)) (from-root addr (get-dest-directory))
addr))]))] addr))]))]
[else null])) [else null]))
variants)) properties))
(attribs))] (attribs))]
[newline? (eq? name 'newline)]) [newline? (eq? name 'newline)])
(let-values ([(content) (cond (let-values ([(content) (cond
@ -1050,7 +1050,7 @@
(if (url-anchor? v) (if (url-anchor? v)
`((a ([name ,(url-anchor-name v)]))) `((a ([name ,(url-anchor-name v)])))
null)) null))
variants) properties)
null) null)
(,(cond (,(cond
[link? 'a] [link? 'a]
@ -1098,16 +1098,16 @@
(cons (cons
`(td (,@(cond `(td (,@(cond
[(not column-style) null] [(not column-style) null]
[(memq 'right (style-variants column-style)) '([align "right"])] [(memq 'right (style-properties column-style)) '([align "right"])]
[(memq 'left (style-variants column-style)) '([align "left"])] [(memq 'left (style-properties column-style)) '([align "left"])]
[(memq 'center (style-variants column-style)) '([align "center"])] [(memq 'center (style-properties column-style)) '([align "center"])]
[else null]) [else null])
,@(cond ,@(cond
[(not column-style) null] [(not column-style) null]
[(memq 'top (style-variants column-style)) '([valign "top"])] [(memq 'top (style-properties column-style)) '([valign "top"])]
[(memq 'baseline (style-variants column-style)) '([valign "baseline"])] [(memq 'baseline (style-properties column-style)) '([valign "baseline"])]
[(memq 'vcenter (style-variants column-style)) '([valign "center"])] [(memq 'vcenter (style-properties column-style)) '([valign "center"])]
[(memq 'bottom (style-variants column-style)) '([valign "bottom"])] [(memq 'bottom (style-properties column-style)) '([valign "bottom"])]
[else null]) [else null])
,@(if (and column-style ,@(if (and column-style
(string? (style-name column-style))) (string? (style-name column-style)))
@ -1124,7 +1124,7 @@
[else n])))]) [else n])))])
null)) null))
,@(if (and (paragraph? d) ,@(if (and (paragraph? d)
(memq 'omitable (style-variants (paragraph-style d)))) (memq 'omitable (style-properties (paragraph-style d))))
(render-content (paragraph-content d) part ri) (render-content (paragraph-content d) part ri)
(render-block d part ri #f))) (render-block d part ri #f)))
(loop (cdr ds) (cdr column-styles) #f)))])))) (loop (cdr ds) (cdr column-styles) #f)))]))))

View File

@ -1,7 +1,7 @@
#lang scheme/base #lang scheme/base
(require "core.ss" (require "core.ss"
"latex-variants.ss" "latex-properties.ss"
"private/render-utils.ss" "private/render-utils.ss"
scheme/class scheme/class
scheme/runtime-path scheme/runtime-path
@ -52,7 +52,7 @@
(define/override (render-one d ri fn) (define/override (render-one d ri fn)
(let* ([defaults (ormap (lambda (v) (and (latex-defaults? v) v)) (let* ([defaults (ormap (lambda (v) (and (latex-defaults? v) v))
(style-variants (part-style d)))] (style-properties (part-style d)))]
[prefix-file (or prefix-file [prefix-file (or prefix-file
(and defaults (and defaults
(let ([v (latex-defaults-prefix defaults)]) (let ([v (latex-defaults-prefix defaults)])
@ -184,7 +184,7 @@
[(1) "Chap"] [(1) "Chap"]
[else "Sec"]) [else "Sec"])
(if (let ([s (element-style e)]) (if (let ([s (element-style e)])
(and (style? s) (memq 'uppercase (style-variants s)))) (and (style? s) (memq 'uppercase (style-properties s))))
"UC" "UC"
"")) ""))
(render-content (render-content
@ -249,7 +249,7 @@
[else (error 'latex-render [else (error 'latex-render
"unrecognzied style symbol: ~s" style)])] "unrecognzied style symbol: ~s" style)])]
[(string? style-name) [(string? style-name)
(let* ([v (if style (style-variants style) null)] (let* ([v (if style (style-properties style) null)]
[tt? (cond [tt? (cond
[(memq 'tt-chars v) #t] [(memq 'tt-chars v) #t]
[(memq 'exact-chars v) 'exact] [(memq 'exact-chars v) 'exact]
@ -267,7 +267,7 @@
(wrap e style-name tt?)]))] (wrap e style-name tt?)]))]
[else [else
(core-render e tt?)])) (core-render e tt?)]))
(let loop ([l (if style (style-variants style) null)] [tt? #f]) (let loop ([l (if style (style-properties style) null)] [tt? #f])
(if (null? l) (if (null? l)
(finish tt?) (finish tt?)
(let ([v (car l)]) (let ([v (car l)])
@ -276,16 +276,16 @@
(printf "\\href{~a}{" (target-url-addr v)) (printf "\\href{~a}{" (target-url-addr v))
(loop (cdr l) #t) (loop (cdr l) #t)
(printf "}")] (printf "}")]
[(color-variant? v) [(color-property? v)
(printf "\\intext~acolor{~a}{" (printf "\\intext~acolor{~a}{"
(if (string? (color-variant-color v)) "" "rgb") (if (string? (color-property-color v)) "" "rgb")
(color->string (color-variant-color v))) (color->string (color-property-color v)))
(loop (cdr l) tt?) (loop (cdr l) tt?)
(printf "}")] (printf "}")]
[(background-color-variant? v) [(background-color-property? v)
(printf "\\in~acolorbox{~a}{" (printf "\\in~acolorbox{~a}{"
(if (string? (background-color-variant-color v)) "" "rgb") (if (string? (background-color-property-color v)) "" "rgb")
(color->string (background-color-variant-color v))) (color->string (background-color-property-color v)))
(loop (cdr l) tt?) (loop (cdr l) tt?)
(printf "}")] (printf "}")]
[else (loop (cdr l) tt?)])))))) [else (loop (cdr l) tt?)]))))))
@ -345,7 +345,7 @@
(not (ormap (lambda (cell-styles) (not (ormap (lambda (cell-styles)
(ormap (lambda (s) (ormap (lambda (s)
(or (string? (style-name s)) (or (string? (style-name s))
(let ([l (style-variants s)]) (let ([l (style-properties s)])
(or (memq 'right l) (or (memq 'right l)
(memq 'center l))))) (memq 'center l)))))
cell-styles)) cell-styles))
@ -401,8 +401,8 @@
(map (lambda (i cell-style) (map (lambda (i cell-style)
(format "~a@{}" (format "~a@{}"
(cond (cond
[(memq 'center (style-variants cell-style)) "c"] [(memq 'center (style-properties cell-style)) "c"]
[(memq 'right (style-variants cell-style)) "r"] [(memq 'right (style-properties cell-style)) "r"]
[else "l"]))) [else "l"])))
(car blockss) (car blockss)
(car cell-styless))) (car cell-styless)))
@ -446,8 +446,8 @@
null) null)
(define/private (render-table-cell p part ri twidth vstyle) (define/private (render-table-cell p part ri twidth vstyle)
(let ([top? (memq 'top (style-variants vstyle))] (let ([top? (memq 'top (style-properties vstyle))]
[center? (memq 'vcenter (style-variants vstyle))]) [center? (memq 'vcenter (style-properties vstyle))])
(when (style-name vstyle) (when (style-name vstyle)
(printf "\\~a{" (style-name vstyle))) (printf "\\~a{" (style-name vstyle)))
(let ([minipage? (and (not (table? p)) (let ([minipage? (and (not (table? p))
@ -498,7 +498,7 @@
(or (and (string? s) s) (or (and (string? s) s)
(and (eq? s 'inset) "quote"))) (and (eq? s 'inset) "quote")))
"Subflow")] "Subflow")]
[command? (memq 'command (style-variants (nested-flow-style t)))]) [command? (memq 'command (style-properties (nested-flow-style t)))])
(if command? (if command?
(printf "\\~a{" kind) (printf "\\~a{" kind)
(printf "\\begin{~a}" kind)) (printf "\\begin{~a}" kind))
@ -517,7 +517,7 @@
(define/override (render-compound-paragraph t part ri starting-item?) (define/override (render-compound-paragraph t part ri starting-item?)
(let ([kind (style-name (compound-paragraph-style t))] (let ([kind (style-name (compound-paragraph-style t))]
[command? (memq 'command (style-variants (compound-paragraph-style t)))]) [command? (memq 'command (style-properties (compound-paragraph-style t)))])
(when kind (when kind
(if command? (if command?
(printf "\\~a{" kind) (printf "\\~a{" kind)

View File

@ -1,24 +1,24 @@
#lang scheme/base #lang scheme/base
(require scribble/core (require scribble/core
scribble/latex-variants scribble/latex-properties
setup/main-collects) setup/main-collects)
(provide scribble-file (provide scribble-file
add-defaults) add-defaults)
(define (add-variant variants pred new) (define (add-property properties pred new)
(if (ormap pred variants) (if (ormap pred properties)
variants properties
(cons new variants))) (cons new properties)))
(define (scribble-file s) (define (scribble-file s)
(path->main-collects-relative (build-path (collection-path "scribble") s))) (path->main-collects-relative (build-path (collection-path "scribble") s)))
(define (add-defaults doc pfx styl extras version?) (define (add-defaults doc pfx styl extras version?)
(struct-copy part doc [style (make-style (style-name (part-style doc)) (struct-copy part doc [style (make-style (style-name (part-style doc))
((if version? add-variant (lambda (x y z) x)) ((if version? add-property (lambda (x y z) x))
(add-variant (add-property
(style-variants (part-style doc)) (style-properties (part-style doc))
latex-defaults? latex-defaults?
(make-latex-defaults (make-latex-defaults
pfx pfx

View File

@ -7,7 +7,7 @@
empty-content?) empty-content?)
(define (part-style? p s) (define (part-style? p s)
(memq s (style-variants (part-style p)))) (memq s (style-properties (part-style p))))
(define (select-suffix path suggested-suffixes accepted-suffixes) (define (select-suffix path suggested-suffixes accepted-suffixes)
(or (ormap (lambda (suggested) (or (ormap (lambda (suggested)
@ -23,7 +23,7 @@
path)) path))
(define (extract-table-cell-styles t) (define (extract-table-cell-styles t)
(let ([vars (style-variants (table-style t))]) (let ([vars (style-properties (table-style t))])
(or (let ([l (ormap (lambda (v) (or (let ([l (ormap (lambda (v)
(and (table-cells? v) (and (table-cells? v)
(table-cells-styless v))) (table-cells-styless v)))
@ -31,12 +31,12 @@
(and l (and l
(unless (= (length l) (length (table-blockss t))) (unless (= (length l) (length (table-blockss t)))
(error 'table (error 'table
"table-cells variant list's length does not match row count: ~e vs. ~e" "table-cells property list's length does not match row count: ~e vs. ~e"
l (length (table-blockss t)))) l (length (table-blockss t))))
(for-each (lambda (l row) (for-each (lambda (l row)
(unless (= (length l) (length row)) (unless (= (length l) (length row))
(error 'table (error 'table
"table-cells variant list contains a row whose length does not match the content: ~e vs. ~e" "table-cells property list contains a row whose length does not match the content: ~e vs. ~e"
l (length row)))) l (length row))))
l (table-blockss t)) l (table-blockss t))
l)) l))
@ -46,7 +46,7 @@
(map (lambda (row) (map (lambda (row)
(unless (= (length cols) (length row)) (unless (= (length cols) (length row))
(error 'table (error 'table
"table-columns variant list's length does not match a row length: ~e vs. ~e" "table-columns property list's length does not match a row length: ~e vs. ~e"
cols (length row))) cols (length row)))
cols) cols)
(table-blockss t))))) (table-blockss t)))))

View File

@ -2,8 +2,8 @@
(require "core.ss" (require "core.ss"
"basic.ss" "basic.ss"
"search.ss" "search.ss"
"html-variants.ss" "html-properties.ss"
"latex-variants.ss" "latex-properties.ss"
mzlib/class mzlib/class
mzlib/for mzlib/for
setup/main-collects setup/main-collects
@ -53,7 +53,7 @@
make-element-id-transformer make-element-id-transformer
element-id-transformer?)) element-id-transformer?))
(define scheme-variants (define scheme-properties
(let ([abs (lambda (s) (let ([abs (lambda (s)
(path->main-collects-relative (build-path (collection-path "scribble") s)))]) (path->main-collects-relative (build-path (collection-path "scribble") s)))])
(list (make-css-addition (abs "scheme.css")) (list (make-css-addition (abs "scheme.css"))
@ -61,8 +61,8 @@
(define (make-scheme-style s #:tt? [tt? #t]) (define (make-scheme-style s #:tt? [tt? #t])
(make-style s (if tt? (make-style s (if tt?
(cons 'tt-chars scheme-variants) (cons 'tt-chars scheme-properties)
scheme-variants))) scheme-properties)))
(define output-color (make-scheme-style "ScmOut")) (define output-color (make-scheme-style "ScmOut"))
(define input-color (make-scheme-style "ScmIn")) (define input-color (make-scheme-style "ScmIn"))

View File

@ -3,8 +3,8 @@
scribble/core scribble/core
scribble/base scribble/base
scribble/decode scribble/decode
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
(for-syntax scheme/base)) (for-syntax scheme/base))
(provide preprint (provide preprint

View File

@ -4,7 +4,7 @@
deserialize-info:target-url-v0) deserialize-info:target-url-v0)
[make-target-url core:make-target-url]) [make-target-url core:make-target-url])
"private/provide-structs.ss" "private/provide-structs.ss"
"html-variants.ss" "html-properties.ss"
scheme/provide-syntax scheme/provide-syntax
scheme/struct-info scheme/struct-info
scheme/contract scheme/contract
@ -180,12 +180,12 @@
(make-style (style-name s) (make-style (style-name s)
(cons (cons
(make-document-version version) (make-document-version version)
(style-variants s)))) (style-properties s))))
to-collect to-collect
(flow-paragraphs flow) (flow-paragraphs flow)
parts)) parts))
(define (versioned-part? p) (define (versioned-part? p)
(and (part? p) (ormap document-version? (style-variants (part-style p))))) (and (part? p) (ormap document-version? (style-properties (part-style p)))))
(define (make-unnumbered-part tag-prefix tags title-content orig-style to-collect flow parts) (define (make-unnumbered-part tag-prefix tags title-content orig-style to-collect flow parts)
(make-part tag-prefix (make-part tag-prefix
@ -193,12 +193,12 @@
(list->content title-content) (list->content title-content)
(let ([s (convert-style orig-style)]) (let ([s (convert-style orig-style)])
(make-style (style-name s) (make-style (style-name s)
(cons 'unnumbered (style-variants s)))) (cons 'unnumbered (style-properties s))))
to-collect to-collect
(flow-paragraphs flow) (flow-paragraphs flow)
parts)) parts))
(define (unnumbered-part? p) (define (unnumbered-part? p)
(and (part? p) (memq 'unnumbered (style-variants (part-style p))))) (and (part? p) (memq 'unnumbered (style-properties (part-style p)))))
(define (make-paragraph/compat content) (define (make-paragraph/compat content)
(make-paragraph plain (list->content content))) (make-paragraph plain (list->content content)))
@ -210,7 +210,7 @@
(define (make-omitable-paragraph content) (define (make-omitable-paragraph content)
(make-paragraph (make-style #f '(omitable)) (list->content content))) (make-paragraph (make-style #f '(omitable)) (list->content content)))
(define (omitable-paragraph? p) (define (omitable-paragraph? p)
(and (paragraph? p) (memq 'omitable (style-variants (paragraph-style p))))) (and (paragraph? p) (memq 'omitable (style-properties (paragraph-style p)))))
(define (make-table/compat style cellss) (define (make-table/compat style cellss)
(make-table (convert-style style) (make-table (convert-style style)
@ -230,11 +230,11 @@
(let ([t (make-table/compat style cells)]) (let ([t (make-table/compat style cells)])
(make-table (make-style (style-name (table-style t)) (make-table (make-style (style-name (table-style t))
(cons 'aux (cons 'aux
(style-variants (table-style t)))) (style-properties (table-style t))))
(table-blockss t)))) (table-blockss t))))
(define (auxiliary-table? t) (define (auxiliary-table? t)
(ormap (lambda (v) (eq? v 'aux) (style-variants (table-style t))))) (ormap (lambda (v) (eq? v 'aux) (style-properties (table-style t)))))
(define (make-itemization/compat flows) (define (make-itemization/compat flows)
(make-itemization plain flows)) (make-itemization plain flows))
@ -251,18 +251,18 @@
(if (style? s) (if (style? s)
(style-name s) (style-name s)
s)) s))
(define (element-style-variants s) (define (element-style-properties s)
(if (style? s) (if (style? s)
(style-variants s) (style-properties s)
null)) null))
(define (add-element-variant v e) (define (add-element-property v e)
(make-element (make-style (element-style-name (element-style e)) (make-element (make-style (element-style-name (element-style e))
(cons v (cons v
(element-style-variants (element-style e)))) (element-style-properties (element-style e))))
(element-content e))) (element-content e)))
(define (check-element-style e pred) (define (check-element-style e pred)
(ormap pred (style-variants (element-style e)))) (ormap pred (style-properties (element-style e))))
(define (handle-image-style ctr style . args) (define (handle-image-style ctr style . args)
(if (image-file? style) (if (image-file? style)
@ -310,33 +310,33 @@
(handle-image-style make-index-element style (list->content content) tag plain-seq etry-seq desc)) (handle-image-style make-index-element style (list->content content) tag plain-seq etry-seq desc))
(define (make-aux-element style content) (define (make-aux-element style content)
(add-element-variant 'aux (make-element/compat style content))) (add-element-property 'aux (make-element/compat style content)))
(define (aux-element? e) (define (aux-element? e)
(check-element-style e (lambda (v) (eq? v 'aux)))) (check-element-style e (lambda (v) (eq? v 'aux))))
(define (make-hover-element style content text) (define (make-hover-element style content text)
(add-element-variant (make-hover-variant text) (add-element-property (make-hover-property text)
(make-element/compat style content))) (make-element/compat style content)))
(define (hover-element? e) (define (hover-element? e)
(check-element-style e hover-variant?)) (check-element-style e hover-property?))
(define (hover-element-text e) (define (hover-element-text e)
(ormap (lambda (v) (ormap (lambda (v)
(and (hover-variant? v) (hover-variant-text e))) (and (hover-property? v) (hover-property-text e)))
(style-variants (element-style e)))) (style-properties (element-style e))))
(define (make-script-element style content type script) (define (make-script-element style content type script)
(add-element-variant (make-script-variant type script) (add-element-property (make-script-property type script)
(make-element/compat style content))) (make-element/compat style content)))
(define (script-element? e) (define (script-element? e)
(check-element-style e script-variant?)) (check-element-style e script-property?))
(define (script-element-type e) (define (script-element-type e)
(ormap (lambda (v) (ormap (lambda (v)
(and (script-variant? v) (script-variant-type e))) (and (script-property? v) (script-property-type e)))
(style-variants (element-style e)))) (style-properties (element-style e))))
(define (script-element-script e) (define (script-element-script e)
(ormap (lambda (v) (ormap (lambda (v)
(and (script-variant? v) (script-variant-script e))) (and (script-property? v) (script-property-script e)))
(style-variants (element-style e)))) (style-properties (element-style e))))
;; ---------------------------------------- ;; ----------------------------------------
@ -352,18 +352,18 @@
(make-style (style-name s) (make-style (style-name s)
(cons (cons
(make-attributes (with-attributes-assoc wa)) (make-attributes (with-attributes-assoc wa))
(style-variants s))))] (style-properties s))))]
[(target-url? s) (let ([s (convert-style (target-url-style s))]) [(target-url? s) (let ([s (convert-style (target-url-style s))])
(make-style (style-name s) (make-style (style-name s)
(cons (cons
(core:make-target-url (target-url-addr s)) (core:make-target-url (target-url-addr s))
(style-variants s))))] (style-properties s))))]
[(image-file? s) (make-style #f null)] [(image-file? s) (make-style #f null)]
[(and (list? s) (pair? s) (eq? (car s) 'color)) [(and (list? s) (pair? s) (eq? (car s) 'color))
(make-style #f (list (make-color-variant (make-style #f (list (make-color-property
(if (string? (cadr s)) (cadr s) (cdr s)))))] (if (string? (cadr s)) (cadr s) (cdr s)))))]
[(and (list? s) (pair? s) (eq? (car s) 'bg-color)) [(and (list? s) (pair? s) (eq? (car s) 'bg-color))
(make-style #f (list (make-background-color-variant (make-style #f (list (make-background-color-property
(if (string? (cadr s)) (cadr s) (cdr s)))))] (if (string? (cadr s)) (cadr s) (cdr s)))))]
[(and (pair? s) [(and (pair? s)
(list? s) (list? s)

View File

@ -6,7 +6,7 @@
scribble/basic scribble/basic
scribble/core scribble/core
scribble/scheme scribble/scheme
scribble/html-variants scribble/html-properties
scribble/manual-struct scribble/manual-struct
scheme/list scheme/list
scheme/string scheme/string

View File

@ -4,7 +4,7 @@
(require "../config.ss" (require "../config.ss"
scribble/manual scribble/manual
scribble/core scribble/core
scribble/html-variants scribble/html-properties
scribble/decode scribble/decode
scheme/list scheme/list
setup/dirs) setup/dirs)
@ -19,14 +19,14 @@
(define (script #:noscript [noscript null] . body) (define (script #:noscript [noscript null] . body)
(make-element (make-style #f (list (make-element (make-style #f (list
(make-script-variant (make-script-property
"text/javascript" "text/javascript"
(flatten body)))) (flatten body))))
noscript)) noscript))
(define (script-ref #:noscript [noscript null] path) (define (script-ref #:noscript [noscript null] path)
(make-element (make-style #f (list (make-element (make-style #f (list
(make-script-variant (make-script-property
"text/javascript" "text/javascript"
path))) path)))
noscript)) noscript))

View File

@ -1,7 +1,7 @@
#lang scribble/doc #lang scribble/doc
@(require "mz.ss" @(require "mz.ss"
scribble/core scribble/core
scribble/html-variants scribble/html-properties
(for-label scheme/help (for-label scheme/help
net/url net/url
scheme/gui)) scheme/gui))

View File

@ -1,8 +1,8 @@
#lang scribble/doc #lang scribble/doc
@(require "mz.ss" @(require "mz.ss"
scribble/core scribble/core
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
scribble/core scribble/core
scheme/list) scheme/list)

View File

@ -75,7 +75,7 @@ from the content. The tag string is combined with the symbol
The @scheme[style] argument can be a style structure, or it can be one The @scheme[style] argument can be a style structure, or it can be one
of the following: a @scheme[#f] that corresponds to a ``plain'' style, of the following: a @scheme[#f] that corresponds to a ``plain'' style,
a string that is used as a @tech{style name}, a symbol that is used as a string that is used as a @tech{style name}, a symbol that is used as
a @tech{variant}, or a list of symbols to be used as @tech{variants}. a @tech{style property}, or a list of symbols to be used as @tech{style properties}.
For information on styles, see @scheme[part]. For example, a style of For information on styles, see @scheme[part]. For example, a style of
@scheme['toc] causes sub-sections to be generated as separate pages in @scheme['toc] causes sub-sections to be generated as separate pages in
multi-page HTML output. multi-page HTML output.
@ -350,7 +350,7 @@ Generates a literal hyperlinked URL.}
element?]{ element?]{
Inserts the hyperlinked title of the section tagged @scheme[tag], but Inserts the hyperlinked title of the section tagged @scheme[tag], but
elements in the title content with the @scheme['aux] @tech{variant} elements in the title content with the @scheme['aux] @tech{style property}
are omitted in the hyperlink label. are omitted in the hyperlink label.
If @scheme[#:doc module-path] is provided, the @scheme[tag] refers to If @scheme[#:doc module-path] is provided, the @scheme[tag] refers to

View File

@ -2,8 +2,8 @@
@(require scribble/manual @(require scribble/manual
scribble/core scribble/core
scribble/decode scribble/decode
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
"utils.ss" "utils.ss"
(for-label scheme/base)) (for-label scheme/base))
@ -20,7 +20,7 @@ extend or configure Scribble fall into two groups:
@item{You may need to drop into the back-end ``language'' of CSS or @item{You may need to drop into the back-end ``language'' of CSS or
Latex to create a specific output effect. For this kind of Latex to create a specific output effect. For this kind of
extension, you will mostly likely attach a extension, you will mostly likely attach a
@scheme[css-addition] or @scheme[tex-addition] @tech{variant} @scheme[css-addition] or @scheme[tex-addition] @tech{style property}
to style, where the addition implements the style name. This to style, where the addition implements the style name. This
kind of extension is described in @secref["extra-style"].} kind of extension is described in @secref["extra-style"].}
@ -29,7 +29,7 @@ extend or configure Scribble fall into two groups:
kind of configuration, you can run the @exec{scribble} command-line kind of configuration, you can run the @exec{scribble} command-line
tool and supply flags like @DFlag{prefix} or @DPFlag{style}, or tool and supply flags like @DFlag{prefix} or @DPFlag{style}, or
you can associate a @scheme[html-defaults] or you can associate a @scheme[html-defaults] or
@scheme[latex-defaults] @tech{variant} to the main document's @scheme[latex-defaults] @tech{style property} to the main document's
style. This kind of configuration is described in style. This kind of configuration is described in
@secref["config-style"].} @secref["config-style"].}
@ -50,7 +50,7 @@ output or a Latex macro/environment for Latex output. In Latex output,
the string is used as a command name for a @scheme[paragraph] the string is used as a command name for a @scheme[paragraph]
and an environment name for a @scheme[table], @scheme[itemization], and an environment name for a @scheme[table], @scheme[itemization],
@scheme[nested-flow], or @scheme[compound-paragraph]; the if style has @scheme[nested-flow], or @scheme[compound-paragraph]; the if style has
a @scheme['commad] @tech{variant} for a @scheme[nested-flow] or a @scheme['command] @tech{style property} for a @scheme[nested-flow] or
@scheme[compound-paragraph], then the style name is used as a command @scheme[compound-paragraph], then the style name is used as a command
instead of an environment. In addition, for an itemization, the style instead of an environment. In addition, for an itemization, the style
string is suffixed with @scheme["Item"] and used as a CSS class or Latex string is suffixed with @scheme["Item"] and used as a CSS class or Latex
@ -58,7 +58,7 @@ macro name to use for the itemization's items (in place of @tt{item}
in the case of Latex). in the case of Latex).
To add a mapping from your own style name to a CSS configuration, add To add a mapping from your own style name to a CSS configuration, add
a @scheme[css-addition] structure instance to a style's @tech{variant} a @scheme[css-addition] structure instance to a style's @tech{style property}
list. To map a style name to a Latex macro or environment, add a list. To map a style name to a Latex macro or environment, add a
scheme[tex-addition] structure instance. A @scheme[css-addition] or scheme[tex-addition] structure instance. A @scheme[css-addition] or
@scheme[tex-addition] is normally associated with the style whose name @scheme[tex-addition] is normally associated with the style whose name
@ -75,7 +75,7 @@ The styles used by @schememodname[scribble/manual] are implemented by
@filepath{scribble} collection. Other libraries, such as @filepath{scribble} collection. Other libraries, such as
@schememodname[scriblib/autobib], similarly implement styles through files @schememodname[scriblib/autobib], similarly implement styles through files
that are associated by @scheme[css-addition] and @scheme[tex-addition] that are associated by @scheme[css-addition] and @scheme[tex-addition]
@tech{variants}. @tech{style properties}.
To avoid collisions with future additions to Scribble, start your To avoid collisions with future additions to Scribble, start your
style name with an uppercase letter that is not @litchar{S}. An style name with an uppercase letter that is not @litchar{S}. An
@ -88,8 +88,8 @@ For example, a Scribble document
@verbatim[#:indent 2]|{ @verbatim[#:indent 2]|{
#lang scribble/manual #lang scribble/manual
@(require scribble/core @(require scribble/core
scribble/html-variants scribble/html-properties
scribble/latex-variants) scribble/latex-properties)
(define inbox-style (define inbox-style
(make-style "InBox" (make-style "InBox"
@ -191,13 +191,13 @@ accompanying files:
When using the @exec{scribble} command-line utility, a document can When using the @exec{scribble} command-line utility, a document can
declare its default style, prefix, and extra files through a declare its default style, prefix, and extra files through a
@scheme[html-defaults] and/or @scheme[latex-defaults] style @scheme[html-defaults] and/or @scheme[latex-defaults]
@tech{variant}. In particular, when using the @exec{scribble} @tech{style property}. In particular, when using the @exec{scribble}
command-line tool to generate Latex or PDF a document whose main part command-line tool to generate Latex or PDF a document whose main part
is implemented with @scheme[#, @hash-lang[] #, is implemented with @scheme[#, @hash-lang[] #,
@schememodname[scribble/manual]], the result has the standard PLT @schememodname[scribble/manual]], the result has the standard PLT
Scheme manual configuration, because @schememodname[scribble/manual] Scheme manual configuration, because @schememodname[scribble/manual]
associates a @scheme[latex-defaults] @tech{variant} with the exported associates a @scheme[latex-defaults] @tech{style property} with the exported
document. The @schememodname[scribble/sigplan] language similarly document. The @schememodname[scribble/sigplan] language similarly
associates a default configuration with an exported document. As associates a default configuration with an exported document. As
libraries imported with @scheme[require], however, libraries imported with @scheme[require], however,
@ -205,10 +205,10 @@ libraries imported with @scheme[require], however,
simply implement new styles in a composable way. simply implement new styles in a composable way.
Whether or not a document has a default prefix- and style-file Whether or not a document has a default prefix- and style-file
configuration through a style @tech{variant}, the defaults can be configuration through a @tech{style property}, the defaults can be
overridden using @exec{scribble} command-line flags. Furthermore, overridden using @exec{scribble} command-line flags. Furthermore,
languages like @schememodname[scribble/manual] and languages like @schememodname[scribble/manual] and
@schememodname[scribble/sigplan] add a @scheme[html-defaults] and/or @schememodname[scribble/sigplan] add a @scheme[html-defaults] and/or
@scheme[latex-defaults] @tech{variant} to a main-document part only if @scheme[latex-defaults] @tech{style property} to a main-document part only if
it does not already have such a variant added through the it does not already have such a property added through the
@scheme[#:style] argument of @scheme[title]. @scheme[#:style] argument of @scheme[title].

View File

@ -195,10 +195,10 @@ example, @scheme[section] and @scheme[secref] both accept a string
@section[#:tag "style"]{Styles} @section[#:tag "style"]{Styles}
A @deftech{style} combines a @tech{style name} with a list of A @deftech{style} combines a @tech{style name} with a list of
@tech{variants} in a @scheme[style] structure. A @deftech{style name} @tech{style properties} in a @scheme[style] structure. A @deftech{style name}
is either a string, symbol, of @scheme[#f]. A @deftech{variant} can be is either a string, symbol, of @scheme[#f]. A @deftech{style property} can be
anything, including a symbol a structure such as anything, including a symbol a structure such as
@scheme[color-variant]. @scheme[color-property].
A style has a single @tech{style name}, because the name typically A style has a single @tech{style name}, because the name typically
corresponds to a configurable instruction to a renderer. For example, corresponds to a configurable instruction to a renderer. For example,
@ -210,11 +210,11 @@ layer of abstraction between the renderer and documents for widely
supported style; for example, the @scheme['italic] style name is supported style; for example, the @scheme['italic] style name is
supported by all renderers. supported by all renderers.
@tech{Variants} within a style compose with style names and other @tech{Style properties} within a style compose with style names and other
variants. Again, symbols are often used for variants that are directly properties. Again, symbols are often used for properties that are directly
supported by renderers. For example, @scheme['unnumbered] style supported by renderers. For example, @scheme['unnumbered] style
variant for a @tech{part} renders the part without a section number. property for a @tech{part} renders the part without a section number.
Many variants are renderer-specific, such as a @scheme[hover-variant] Many properties are renderer-specific, such as a @scheme[hover-property]
structure that associates text with an element to be shown in an structure that associates text with an element to be shown in an
HTML display when the mouse hovers over the text. HTML display when the mouse hovers over the text.
@ -285,7 +285,7 @@ names are as follows:
] ]
The recognized @tech{variants} are as follows: The recognized @tech{style properties} are as follows:
@itemize[ @itemize[
@ -369,7 +369,7 @@ recognized:
] ]
The currently recognized style @tech{variants} are as follows: The currently recognized @tech{style properties} are as follows:
@itemize[ @itemize[
@ -410,13 +410,13 @@ recognized:
] ]
The following style @tech{variants} are currently recognized: The following @tech{style properties} are currently recognized:
@itemize[ @itemize[
@item{@scheme[table-columns] structure --- Provides column-specific @item{@scheme[table-columns] structure --- Provides column-specific
styles, but only if a @scheme[table-cells] structure is not styles, but only if a @scheme[table-cells] structure is not
included as a @tech{variant}.} included as a @tech{style property}.}
@item{@scheme[table-cells] structure --- Provides cell-specific @item{@scheme[table-cells] structure --- Provides cell-specific
styles.} styles.}
@ -434,8 +434,8 @@ The following style @tech{variants} are currently recognized:
For Latex output, a paragraph as a cell value is not automatically For Latex output, a paragraph as a cell value is not automatically
line-wrapped, unless a vertical alignment is specified for the cell line-wrapped, unless a vertical alignment is specified for the cell
through a @scheme[table-cells] or @scheme[table-columns] style through a @scheme[table-cells] or @scheme[table-columns]
@tech{variant}. To get a line-wrapped paragraph, use a @tech{style property}. To get a line-wrapped paragraph, use a
@scheme[compound-paragraph] or use an element with a string style and @scheme[compound-paragraph] or use an element with a string style and
define a corresponding Latex macro in terms of @tt{parbox}. For Latex define a corresponding Latex macro in terms of @tt{parbox}. For Latex
output of blocks in the flow that are @scheme[nested-flow]s, output of blocks in the flow that are @scheme[nested-flow]s,
@ -463,7 +463,7 @@ names are recognized:
itemization.} itemization.}
] ]
The following style @tech{variants} are currently recognized: The following @tech{style properties} are currently recognized:
@itemize[ @itemize[
@ -493,7 +493,7 @@ names are recognized:
] ]
The following style @tech{variants} are currently recognized: The following @tech{style properties} are currently recognized:
@itemize[ @itemize[
@ -522,8 +522,8 @@ non-@scheme[#f] @tech{style name}.
The @scheme[style] field of a compound paragraph is normally a string The @scheme[style] field of a compound paragraph is normally a string
that corresponds to a CSS class for HTML output or Latex environment that corresponds to a CSS class for HTML output or Latex environment
for Latex output (see @secref["extra-style"]). The following style for Latex output (see @secref["extra-style"]). The following
@tech{variants} are currently recognized: @tech{style properties} are currently recognized:
@itemize[ @itemize[
@ -577,7 +577,7 @@ recognized:
] ]
The following style @tech{variants} are currently recognized: The following @tech{style properties} are currently recognized:
@itemize[ @itemize[
@ -586,20 +586,20 @@ The following style @tech{variants} are currently recognized:
@item{@scheme[url-anchor] structure --- For HTML, inserts a hyperlink @item{@scheme[url-anchor] structure --- For HTML, inserts a hyperlink
target before @scheme[content].} target before @scheme[content].}
@item{@scheme[color-variant] structure --- Applies a color to the @item{@scheme[color-property] structure --- Applies a color to the
text of @scheme[content].} text of @scheme[content].}
@item{@scheme[background-color-variant] structure --- Applies a color to the @item{@scheme[background-color-property] structure --- Applies a color to the
background of @scheme[content].} background of @scheme[content].}
@item{@scheme[attributes] structure --- Provides additional HTML @item{@scheme[attributes] structure --- Provides additional HTML
attributes for a @tt{<span>} tag.} attributes for a @tt{<span>} tag.}
@item{@scheme[hover-variant] structure --- For HTML, adds a text @item{@scheme[hover-property] structure --- For HTML, adds a text
label to the content to be shown when the mouse hovers over label to the content to be shown when the mouse hovers over
it.} it.}
@item{@scheme[script-variant] structure --- For HTML, supplies a @item{@scheme[script-property] structure --- For HTML, supplies a
script alternative to @scheme[content].} script alternative to @scheme[content].}
@item{@scheme[body-id] structure --- For HTML uses the given @item{@scheme[body-id] structure --- For HTML uses the given
@ -675,7 +675,7 @@ When @scheme[tag] is a part tag and the content of the element is
@scheme[null], then the hyperlink uses the target part's number and/or @scheme[null], then the hyperlink uses the target part's number and/or
title as the content. In that case, if the section number is preceded title as the content. In that case, if the section number is preceded
by a word, the word starts in uppercase if the element's style includes a by a word, the word starts in uppercase if the element's style includes a
@scheme['uppercase] variant.} @scheme['uppercase] property.}
@defstruct[(index-element element) ([tag tag?] @defstruct[(index-element element) ([tag tag?]
@ -781,20 +781,20 @@ Computed for each part by the @techlink{collect pass}.}
@defstruct[target-url ([addr path-string?])]{ @defstruct[target-url ([addr path-string?])]{
Used as a style @tech{variant} for an @scheme[element]. A path is Used as a @tech{style property} for an @scheme[element]. A path is
allowed for @scheme[addr], but a string is interpreted as a URL rather allowed for @scheme[addr], but a string is interpreted as a URL rather
than a file path.} than a file path.}
@defstruct[document-version ([text (or/c string? false/c)])]{ @defstruct[document-version ([text (or/c string? false/c)])]{
Used as a style @tech{variant} for a @scheme[path] to indicate a Used as a @tech{style property} for a @scheme[path] to indicate a
version number.} version number.}
@defstruct[color-variant ([color (or/c string? (list/c byte? byte? byte?))])]{ @defstruct[color-property ([color (or/c string? (list/c byte? byte? byte?))])]{
Used as a style @tech{variant} for an @scheme[element] to set its Used as a @tech{style property} for an @scheme[element] to set its
color. Recognized string names for @scheme[color] depend on the color. Recognized string names for @scheme[color] depend on the
renderer, but at the recognized set includes at least renderer, but at the recognized set includes at least
@scheme["white"], @scheme["black"], @scheme["red"], @scheme["green"], @scheme["white"], @scheme["black"], @scheme["red"], @scheme["green"],
@ -803,19 +803,19 @@ renderer, but at the recognized set includes at least
are used as RGB levels.} are used as RGB levels.}
@defstruct[background-color-variant ([color (or/c string? (list/c byte? byte? byte?))])]{ @defstruct[background-color-property ([color (or/c string? (list/c byte? byte? byte?))])]{
Like @scheme[color-variant], but sets the background color.} Like @scheme[color-property], but sets the background color.}
@defstruct[table-cells ([styless (listof (listof style?))])]{ @defstruct[table-cells ([styless (listof (listof style?))])]{
Used as a style @tech{variant} for a @scheme[table] to set its cells' Used as a @tech{style property} for a @scheme[table] to set its cells'
styles. styles.
If a cell style has a string name, it is used as an HTML class for the If a cell style has a string name, it is used as an HTML class for the
@tt{<td>} tag or as a Latex command name. @tt{<td>} tag or as a Latex command name.
The following symbols are recognized as cell-style @tech{variants}: The following symbols are recognized as cell-@tech{style properties}:
@itemize[ @itemize[
@ -839,8 +839,8 @@ The following symbols are recognized as cell-style @tech{variants}:
@defstruct[table-columns ([styles (listof style?)])]{ @defstruct[table-columns ([styles (listof style?)])]{
Like @scheme[table-cells], but the @scheme[styles] list is duplicated Like @scheme[table-cells], but the @scheme[styles] list is duplicated
for each row in the table. This @tech{variant} is only when a for each row in the table. This @tech{style property} is only when a
@scheme[table-cells] is not present in a style's list of variants.} @scheme[table-cells] is not present in a style's list of properties.}
@defproc[(block? [v any/c]) boolean?]{ @defproc[(block? [v any/c]) boolean?]{
@ -858,7 +858,7 @@ otherwise.}
@defstruct[style ([name (or/c string? symbol? #f)] @defstruct[style ([name (or/c string? symbol? #f)]
[variants list?])]{ [properties list?])]{
Represents a @techlink{style}.} Represents a @techlink{style}.}
@ -1036,43 +1036,43 @@ Converts a @scheme[generated-tag] value with @scheme[t] to a string.
@; ---------------------------------------- @; ----------------------------------------
@section{HTML Style Variants} @section{HTML Style Properties}
@defmodule[scribble/html-variants]{ The @defmodule[scribble/html-properties]{ The
@scheme[scribble/html-variants] library provides datatypes used as @scheme[scribble/html-properties] library provides datatypes used as
style @tech{variants} for HTML rendering.} @tech{style properties} for HTML rendering.}
@defstruct[attributes ([assoc (listof (cons/c symbol? string?))])]{ @defstruct[attributes ([assoc (listof (cons/c symbol? string?))])]{
Used as a style @tech{variant} to add arbitrary attributes to an HTML Used as a @tech{style property} to add arbitrary attributes to an HTML
tag.} tag.}
@defstruct[url-anchor ([name string?])]{ @defstruct[url-anchor ([name string?])]{
Used as a style @tech{variant} with @scheme[element] to insert an Used as a @tech{style property} with @scheme[element] to insert an
anchor before the element.} anchor before the element.}
@defstruct[hover-variant ([text string?])]{ @defstruct[hover-property ([text string?])]{
Used as a style @tech{variant} with @scheme[element] to add text that Used as a @tech{style property} with @scheme[element] to add text that
is shown when the mouse hovers over the element.} is shown when the mouse hovers over the element.}
@defstruct[script-variant ([type string?] @defstruct[script-property ([type string?]
[script (or/c path-string? (listof string?))])]{ [script (or/c path-string? (listof string?))])]{
Used as a style @tech{variant} with @scheme[element] to supply a Used as a @tech{style property} with @scheme[element] to supply a
script alternative to the element content.} script alternative to the element content.}
@defstruct[css-addition ([path (or/c path-string? @defstruct[css-addition ([path (or/c path-string?
(cons/c 'collects (listof bytes?)))])]{ (cons/c 'collects (listof bytes?)))])]{
Used as a style @tech{variant} to supply a CSS file to be referenced Used as a @tech{style property} to supply a CSS file to be referenced
in the generated HTML. This variant can be attached to any style, and in the generated HTML. This property can be attached to any style, and
all additions are collected to the top of the generated HTML page. all additions are collected to the top of the generated HTML page.
The @scheme[path] field can be a result of The @scheme[path] field can be a result of
@ -1081,7 +1081,7 @@ The @scheme[path] field can be a result of
@defstruct[body-id ([value string?])]{ @defstruct[body-id ([value string?])]{
Used as a style @tech{variant} to associate an @tt{id} attribute with Used as a @tech{style property} to associate an @tt{id} attribute with
an HTML tag.} an HTML tag.}
@ -1099,18 +1099,18 @@ Like @scheme[latex-defaults], but use for the
@; ---------------------------------------- @; ----------------------------------------
@section{Latex Style Variants} @section{Latex Style Properties}
@defmodule[scribble/latex-variants]{ The @defmodule[scribble/latex-properties]{ The
@scheme[scribble/latex-variants] library provides datatypes used as @scheme[scribble/latex-properties] library provides datatypes used as
style @tech{variants} for Latex rendering.} @tech{style properties} for Latex rendering.}
@defstruct[tex-addition ([path (or/c path-string? @defstruct[tex-addition ([path (or/c path-string?
(cons/c 'collects (listof bytes?)))])]{ (cons/c 'collects (listof bytes?)))])]{
Used as a style @tech{variant} to supply a @filepath{.tex} file to be Used as a @tech{style property} to supply a @filepath{.tex} file to be
included in the generated Latex. This variant can be attached to any included in the generated Latex. This property can be attached to any
style, and all additions are collected to the top of the generated style, and all additions are collected to the top of the generated
Latex file. Latex file.
@ -1125,7 +1125,7 @@ The @scheme[path] field can be a result of
[extra-files (listof (or/c path-string? [extra-files (listof (or/c path-string?
(cons/c 'collects (listof bytes?))))])]{ (cons/c 'collects (listof bytes?))))])]{
Used as a style @tech{variant} on the main @scheme[part] of a document Used as a @tech{style property} on the main @scheme[part] of a document
to set a default prefix file, style file, and extra files (see to set a default prefix file, style file, and extra files (see
@secref["config-style"]). The defaults are used by the @secref["config-style"]). The defaults are used by the
@exec{scribble} command-line tool for and @DFlag{latex} or @DFlag{pdf} @exec{scribble} command-line tool for and @DFlag{latex} or @DFlag{pdf}
@ -1136,18 +1136,18 @@ be a result of @scheme[path->main-collects-relative].
Languages (used with @hash-lang[]) like Languages (used with @hash-lang[]) like
@schememodname[scribble/manual] and @schememodname[scribble/sigplan] @schememodname[scribble/manual] and @schememodname[scribble/sigplan]
add this variant to a document to specify appropriate files for Latex add this property to a document to specify appropriate files for Latex
rendering.} rendering.}
@defstruct[latex-auto-extra-files ([paths (listof (or/c path-string? @defstruct[latex-auto-extra-files ([paths (listof (or/c path-string?
(cons/c 'collects (listof bytes?))))])]{ (cons/c 'collects (listof bytes?))))])]{
Used as a style @tech{variant} for the main @scheme[part] of a Used as a @tech{style property} for the main @scheme[part] of a
document to supply extra files needed to build the document via the document to supply extra files needed to build the document via the
@exec{scribble} command-line tool (for @DFlag{latex} and @DFlag{pdf} @exec{scribble} command-line tool (for @DFlag{latex} and @DFlag{pdf}
mode). mode).
Languages (used with @hash-lang[]) like Languages (used with @hash-lang[]) like
@schememodname[scribble/sigplan] add this variant to a document to specify @schememodname[scribble/sigplan] add this property to a document to specify
appropriate extra files.} appropriate extra files.}

View File

@ -45,17 +45,6 @@ the @litchar{``apple''} argument is decoded to use fancy quotes, and
then it is bolded. then it is bolded.
@defproc[(pre-flow? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a @deftech{pre-flow} value: a
string or other non-list @scheme[content], a @scheme[block?], or a
@scheme[splice] containing a list of @tech{pre-flow} values; otherwise
returns @scheme[#f].
Pre-flow is decoded into a @tech{flow} (i.e., a list of @tech{blocks})
by functions like @scheme[decode] and @scheme[decode-flow].}
@defproc[(pre-content? [v any/c]) boolean?]{ @defproc[(pre-content? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a @deftech{pre-content} value: a Returns @scheme[#t] if @scheme[v] is a @deftech{pre-content} value: a
@ -67,7 +56,31 @@ Pre-content is decoded into @tech{content} by functions like
@scheme[decode-content] and @scheme[decode-paragraph].} @scheme[decode-content] and @scheme[decode-paragraph].}
@defproc[(decode [lst list?]) part?]{ @defproc[(pre-flow? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a @deftech{pre-flow} value: a
string or other non-list @scheme[content], a @scheme[block], or a
@scheme[splice] containing a list of @tech{pre-flow} values; otherwise
returns @scheme[#f].
Pre-flow is decoded into a @tech{flow} (i.e., a list of @tech{blocks})
by functions like @scheme[decode-flow].}
@defproc[(pre-part? [v any/c]) boolean?]{
Returns @scheme[#t] if @scheme[v] is a @deftech{pre-part} value: a
string or other non-list @scheme[content], a @scheme[block], a
@scheme[part], a @scheme[title-decl], a @scheme[part-start], a
@scheme[part-index-decl], a @scheme[part-collect-decl], a
@scheme[part-tag-decl], or a @scheme[splice] containing a list of
@tech{pre-part} values; otherwise returns @scheme[#f].
A pre-part sequences is decoded into a @scheme[part] by functions like
@scheme[decode] and @scheme[decode-part].}
@defproc[(decode [lst (listof pre-part?)]) part?]{
Decodes a document, producing a part. In @scheme[lst], instances of Decodes a document, producing a part. In @scheme[lst], instances of
@scheme[splice] are inlined into the list. An instance of @scheme[splice] are inlined into the list. An instance of
@ -84,10 +97,10 @@ flow-element datatypes are used as-is in the enclosing flow.
} }
@defproc[(decode-part [lst list?] @defproc[(decode-part [lst (listof pre-part?)]
[tags (listof string?)] [tags (listof string?)]
[title (or/c false/c list?)] [title (or/c #f list?)]
[depth excat-nonnegative-integer?]) [depth exact-nonnegative-integer?])
part?]{ part?]{
Like @scheme[decode], but given a list of tag string for the part, a Like @scheme[decode], but given a list of tag string for the part, a
@ -146,9 +159,9 @@ otherwise.
} }
@defstruct[title-decl ([tag-prefix (or/c false/c string?)] @defstruct[title-decl ([tag-prefix (or/c #f string?)]
[tags (listof string?)] [tags (listof string?)]
[version (or/c string? false/c)] [version (or/c string? #f)]
[style any/c] [style any/c]
[content content?])]{ [content content?])]{
@ -159,7 +172,7 @@ and @scheme[style] fields are propagated to the resulting
} }
@defstruct[part-start ([depth integer?] @defstruct[part-start ([depth integer?]
[tag-prefix (or/c false/c string?)] [tag-prefix (or/c #f string?)]
[tags (listof string?)] [tags (listof string?)]
[style any/c] [style any/c]
[title content?])]{ [title content?])]{

View File

@ -1,7 +1,8 @@
#lang scribble/doc #lang scribble/doc
@(require scribble/manual @(require scribble/manual
scribble/bnf scribble/bnf
"utils.ss") "utils.ss"
(for-label scriblib/figure))
@(define (sample . text) (nested #:style 'inset (apply verbatim text))) @(define (sample . text) (nested #:style 'inset (apply verbatim text)))
@(define (result . text) (apply nested #:style 'inset text)) @(define (result . text) (apply nested #:style 'inset text))
@ -155,7 +156,7 @@ into one document that is the same as before.
@; ---------------------------------------- @; ----------------------------------------
@section{Document Styles} @section{Document Styles}
Scribble currently supports only one from of HTML output. You can Scribble currently supports only one form of HTML output. You can
replace the @filepath{scribble.css} file for the generated pages, and replace the @filepath{scribble.css} file for the generated pages, and
that's about it. (We expect to add more styles in the future.) that's about it. (We expect to add more styles in the future.)
@ -466,7 +467,7 @@ For example the text-mode stream
@section[#:tag "poetry"]{Of Mice and Cookies} @section[#:tag "poetry"]{Of Mice and Cookies}
See @secref["milk"]. See @secref["milk"].
@section[#:tag "milk"]{@italic{Important} Things About Milk} @section[#:tag "milk"]{@italic{Important} Stuff About Milk}
@figure["straw" @elem{A straw}]{@image["straw.png"]} @figure["straw" @elem{A straw}]{@image["straw.png"]}
}| }|
@ -478,7 +479,7 @@ is equivalent to the Scheme-mode sequence
(section #:tag "poetry" "Of Mice and Cookies") "\n" (section #:tag "poetry" "Of Mice and Cookies") "\n"
"See " (secref "milk") "." "\n" "See " (secref "milk") "." "\n"
"\n" "\n"
(section #:tag "milk" (italic "Important") " Things About Milk") "\n" (section #:tag "milk" (italic "Important") " Milk Supplies") "\n"
(figure "straw" (elem "A straw") (image "straw.png")) "\n" (figure "straw" (elem "A straw") (image "straw.png")) "\n"
] ]

View File

@ -1,8 +1,8 @@
#lang scribble/doc #lang scribble/doc
@(require scribble/manual @(require scribble/manual
scribble/core scribble/core
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
scheme/runtime-path scheme/runtime-path
(prefix-in lp-ex: "lp-ex-doc.scrbl") (prefix-in lp-ex: "lp-ex-doc.scrbl")
"utils.ss" "utils.ss"

View File

@ -20,10 +20,10 @@ bindings, but without setting the reader or setting the default
rendering format to the PLT Scheme manual format.} rendering format to the PLT Scheme manual format.}
With @hash-lang[], @schememodname[scribble/manual] associates a With @hash-lang[], @schememodname[scribble/manual] associates a
@scheme[latex-defaults] style @tech{variant} with its @scheme[doc] @scheme[latex-defaults] @tech{style property} with its @scheme[doc]
export to select the default PLT Scheme manual style for Latex export to select the default PLT Scheme manual style for Latex
rendering---unless a style is supplied to @scheme[title] that already rendering---unless a style is supplied to @scheme[title] that already
includes a @scheme[latex-defaults] @tech{variant}. includes a @scheme[latex-defaults] @tech{style property}.
@local-table-of-contents[] @local-table-of-contents[]
@ -819,7 +819,7 @@ as a member of the signature named by @scheme[sig-id].}
@section[#:tag "doc-strings"]{Various String Forms} @section[#:tag "doc-strings"]{Various String Forms}
@defproc[(aux-elem [pre-content any/c] ...) element?]{ @defproc[(aux-elem [pre-content any/c] ...) element?]{
Like @scheme[elem], but adds an @scheme['aux] style @tech{variant}.} Like @scheme[elem], but adds an @scheme['aux] @tech{style property}.}
@defproc[(defterm [pre-content any/c] ...) element?]{Typesets the @defproc[(defterm [pre-content any/c] ...) element?]{Typesets the
@tech{decode}d @scheme[pre-content] as a defined term (e.g., in @tech{decode}d @scheme[pre-content] as a defined term (e.g., in

View File

@ -1,6 +1,6 @@
#lang scribble/doc #lang scribble/doc
@(require scribble/manual @(require scribble/manual
scribble/core scribble/html-variants scribble/latex-variants scribble/core scribble/html-properties scribble/latex-properties
"utils.ss" "utils.ss"
(for-label scheme/base (for-label scheme/base
;; FIXME: need to get this in ;; FIXME: need to get this in

View File

@ -83,9 +83,9 @@ coerced to one.}
)]{ )]{
@compat[] Like @scheme[make-part], but adds a the @compat[] Like @scheme[make-part], but adds a the
@scheme[document-version] style @tech{variant} using the given @scheme[document-version] @tech{style property} using the given
@scheme[version]. The @scheme[versioned-part?] predicate recognizes a @scheme[version]. The @scheme[versioned-part?] predicate recognizes a
@scheme[part] with a @scheme[document-version] variant.} @scheme[part] with a @scheme[document-version] property.}
@deftogether[( @deftogether[(
@defproc[(make-unnumbered-part [tag-prefix (or/c false/c string?)] @defproc[(make-unnumbered-part [tag-prefix (or/c false/c string?)]
@ -100,8 +100,8 @@ coerced to one.}
)]{ )]{
@compat[] Like @scheme[make-part], but adds the @scheme['unnumbered] @compat[] Like @scheme[make-part], but adds the @scheme['unnumbered]
style @tech{variant}. The @scheme[unnumbered-part?] predicate @tech{style property}. The @scheme[unnumbered-part?] predicate
recognizes a @scheme[part] with the @scheme['unnumbered] variant.} recognizes a @scheme[part] with the @scheme['unnumbered] property.}
@defproc[(make-paragraph [content list?]) paragraph?]{ @defproc[(make-paragraph [content list?]) paragraph?]{
@ -135,9 +135,9 @@ to the current one. The @scheme[styled-paragraph?] predicate and
)]{ )]{
@compat[] Like @scheme[make-paragraph], but adds the @compat[] Like @scheme[make-paragraph], but adds the
@scheme['omitable] style @tech{variant}. The @scheme['omitable] @tech{style property}. The
@scheme[omitable-paragraph?] predicate checks for a paragraph with the @scheme[omitable-paragraph?] predicate checks for a paragraph with the
variant.} property.}
@defproc[(make-table [style any/c] @defproc[(make-table [style any/c]
@ -185,9 +185,9 @@ parsed to the current format.}
@defproc[(auxiliary-table? [v any/c]) boolean?] @defproc[(auxiliary-table? [v any/c]) boolean?]
)]{ )]{
@compat[] Like @scheme[make-table], but adds the @scheme['aux] style @compat[] Like @scheme[make-table], but adds the @scheme['aux]
@tech{variant}. The @scheme[auxiliary-table?] predicate recognizes @tech{style property}. The @scheme[auxiliary-table?] predicate recognizes
tables with the @scheme['aux] variant.} tables with the @scheme['aux] property.}
@defproc[(make-compound-paragraph [style any/c] @defproc[(make-compound-paragraph [style any/c]
@ -227,20 +227,20 @@ and the result of @scheme[element-content] is always a list.}
@defproc[(make-aux-element [style any/c] [content list?]) element?]{ @defproc[(make-aux-element [style any/c] [content list?]) element?]{
@compat[] Like @scheme[make-element], but adds the @scheme['aux] style @compat[] Like @scheme[make-element], but adds the @scheme['aux]
@tech{variant}.} @tech{style property}.}
@defproc[(make-hover-element [style any/c] [content list?] [text string?]) element?]{ @defproc[(make-hover-element [style any/c] [content list?] [text string?]) element?]{
@compat[] Like @scheme[make-element], but adds @scheme[hover-variant] @compat[] Like @scheme[make-element], but adds @scheme[hover-property]
containing @scheme[text] to the element's style.} containing @scheme[text] to the element's style.}
@defproc[(make-script-element [style any/c] [content list?] [type string?] @defproc[(make-script-element [style any/c] [content list?] [type string?]
[script (or/c path-string? (listof string?))]) element?]{ [script (or/c path-string? (listof string?))]) element?]{
@compat[] Like @scheme[make-element], but adds @scheme[script-variant] @compat[] Like @scheme[make-element], but adds @scheme[script-property]
containing @scheme[type] and @scheme[script] to the element's style.} containing @scheme[type] and @scheme[script] to the element's style.}

View File

@ -1,7 +1,7 @@
#lang scheme/base #lang scheme/base
(require scribble/core (require scribble/core
scribble/html-variants scribble/html-properties
scribble/manual scribble/manual
(prefix-in scheme: scribble/scheme) (prefix-in scheme: scribble/scheme)
(prefix-in scribble: scribble/reader)) (prefix-in scribble: scribble/reader))
@ -21,8 +21,8 @@
scribble/decode scribble/decode
scribble/manual scribble/manual
scribble/scheme scribble/scheme
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
scribble/eval scribble/eval
scribble/bnf) scribble/bnf)
@ -155,7 +155,7 @@
(map (lambda (file strs) (map (lambda (file strs)
(let* ([file (make-element 'tt (list file ":" 'nbsp))] (let* ([file (make-element 'tt (list file ":" 'nbsp))]
[file (list (make-element 'italic (list file)))]) [file (list (make-element 'italic (list file)))])
(list (as-flow (make-element (make-style #f (list (make-background-color-variant '(232 232 255)))) file)) (list (as-flow (make-element (make-style #f (list (make-background-color-property '(232 232 255)))) file))
(as-flow (make-box strs))))) (as-flow (make-box strs)))))
filenames strsm))) filenames strsm)))
(make-box strs2))) (make-box strs2)))

View File

@ -2,8 +2,8 @@
(require scribble/manual (require scribble/manual
scribble/core scribble/core
scribble/decode scribble/decode
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
scheme/string scheme/string
setup/main-collects) setup/main-collects)

View File

@ -3,8 +3,8 @@
(require scribble/manual (require scribble/manual
scribble/core scribble/core
scribble/decode scribble/decode
scribble/html-variants scribble/html-properties
scribble/latex-variants scribble/latex-properties
setup/main-collects setup/main-collects
"private/counter.ss") "private/counter.ss")
@ -12,7 +12,8 @@
figure* figure*
figure** figure**
Figure-target Figure-target
Figure-ref) Figure-ref
figure-ref)
(define figure-style-extras (define figure-style-extras
(let ([abs (lambda (s) (let ([abs (lambda (s)
@ -39,8 +40,8 @@
plain plain
(list (list
(make-element legend-style (make-element legend-style
(list* (Figure-target tag) ": " (list (Figure-target tag) ": "
(decode-content (list caption)))))))))))) caption))))))))))
(define (*figure style tag caption content) (define (*figure style tag caption content)
(make-nested-flow (make-nested-flow
@ -55,8 +56,8 @@
plain plain
(list (list
(make-element legend-style (make-element legend-style
(list* (Figure-target tag) ": " (list (Figure-target tag) ": "
(decode-content (list caption)))))))))))) caption))))))))))
(define (figure* tag caption . content) (define (figure* tag caption . content)
(*figure centerfiguremulti-style tag caption content)) (*figure centerfiguremulti-style tag caption content))
@ -68,3 +69,5 @@
(counter-target figures tag "Figure")) (counter-target figures tag "Figure"))
(define (Figure-ref tag) (define (Figure-ref tag)
(make-element #f (list (counter-ref figures tag "Figure")))) (make-element #f (list (counter-ref figures tag "Figure"))))
(define (figure-ref tag)
(make-element #f (list (counter-ref figures tag "figure"))))

View File

@ -16,14 +16,14 @@ rendering support.}
@deftogether[( @deftogether[(
@defproc[(figure [tag string?] [caption any/c] [pre-content any/c] ...) block?] @defproc[(figure [tag string?] [caption content?] [pre-flow pre-flow?] ...) block?]
@defproc[(figure* [tag string?] [caption any/c] [pre-content any/c] ...) block?] @defproc[(figure* [tag string?] [caption content?] [pre-flow pre-flow?] ...) block?]
@defproc[(figure** [tag string?] [caption any/c] [pre-content any/c] ...) block?] @defproc[(figure** [tag string?] [caption content?] [pre-flow pre-flow?] ...) block?]
)]{ )]{
Creates a figure. The given @scheme[tag] is for use with Creates a figure. The given @scheme[tag] is for use with
@scheme[Figure-ref]. The @scheme[caption] is an element. The @scheme[figure-ref] or @scheme[fFgure-ref]. The @scheme[caption] is an
@scheme[pre-content] is decoded as a flow. element. The @scheme[pre-flow] is decoded as a flow.
For HTML output, the @scheme[figure*] and @scheme[figure*] functions For HTML output, the @scheme[figure*] and @scheme[figure*] functions
center the figure content, while @scheme[figure**] allows the content center the figure content, while @scheme[figure**] allows the content
@ -32,12 +32,18 @@ to be wider than the document body.
For two-column latex output, @scheme[figure*] and @scheme[figure**] For two-column latex output, @scheme[figure*] and @scheme[figure**]
generate a figure that spans columns.} generate a figure that spans columns.}
@defproc[(Figure-target [tag string?]) element?]{
Generates a new figure label---normally not used directly, since it is @defproc[(figure-ref [tag string?]) element?]{
used by @scheme[figure].}
Generates a reference to a figure, using a lowercase word ``figure''.}
@defproc[(Figure-ref [tag string?]) element?]{ @defproc[(Figure-ref [tag string?]) element?]{
Generates a reference to a figure.} Generates a reference to a figure, capitalizing the word ``Figure''.}
@defproc[(Figure-target [tag string?]) element?]{
Generates a new figure label. This function is normally not used
directly, since it is used by @scheme[figure].}

View File

@ -13,7 +13,7 @@
syntax/modread syntax/modread
scribble/base-render scribble/base-render
scribble/core scribble/core
scribble/html-variants scribble/html-properties
scribble/manual ; really shouldn't be here... see dynamic-require-doc scribble/manual ; really shouldn't be here... see dynamic-require-doc
scribble/private/run-pdflatex scribble/private/run-pdflatex
(prefix-in html: scribble/html-render) (prefix-in html: scribble/html-render)
@ -330,7 +330,7 @@
tag-prefix tag-prefix
tags tags
(part-title-content v) (part-title-content v)
(let* ([v (style-variants style)] (let* ([v (style-properties style)]
[v (if (ormap body-id? v) [v (if (ormap body-id? v)
v v
(cons (make-body-id "doc-plt-scheme-org") (cons (make-body-id "doc-plt-scheme-org")

View File

@ -13,12 +13,12 @@
consistently.) consistently.)
*/ */
#define MZSCHEME_VERSION "4.2.1.2" #define MZSCHEME_VERSION "4.2.1.3"
#define MZSCHEME_VERSION_X 4 #define MZSCHEME_VERSION_X 4
#define MZSCHEME_VERSION_Y 2 #define MZSCHEME_VERSION_Y 2
#define MZSCHEME_VERSION_Z 1 #define MZSCHEME_VERSION_Z 1
#define MZSCHEME_VERSION_W 2 #define MZSCHEME_VERSION_W 3
#define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y) #define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y)
#define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W) #define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W)