diff --git a/collects/scribble/base-render.rkt b/collects/scribble/base-render.rkt index c9a428e6..99a10c65 100644 --- a/collects/scribble/base-render.rkt +++ b/collects/scribble/base-render.rkt @@ -76,7 +76,7 @@ (unless (stop-at-part? p) (loop p #f #f))) (part-parts p))))) - (for/list ([k (in-hash-keys ht)]) (main-collects-relative->path k)))) + (for/list ([k (in-hash-keys ht)]) (if (bytes? k) k (main-collects-relative->path k))))) (define/private (extract-style-style-files s ht pred extract) (for ([v (in-list (style-properties s))]) diff --git a/collects/scribble/html-properties.rkt b/collects/scribble/html-properties.rkt index 9d46cabc..0644a511 100644 --- a/collects/scribble/html-properties.rkt +++ b/collects/scribble/html-properties.rkt @@ -7,7 +7,7 @@ [hover-property ([text string?])] [script-property ([type 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?)) 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?)))] [extra-files (listof (or/c path-string? (cons/c 'collects (listof bytes?))))])] diff --git a/collects/scribble/latex-properties.rkt b/collects/scribble/latex-properties.rkt index 7e6396aa..5ad7a87c 100644 --- a/collects/scribble/latex-properties.rkt +++ b/collects/scribble/latex-properties.rkt @@ -3,7 +3,7 @@ racket/contract/base) (provide-structs - [tex-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)))])] + [tex-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)) bytes?)])] [latex-defaults ([prefix (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] [style (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] [extra-files (listof (or/c path-string? (cons/c 'collects (listof bytes?))))])]) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index f0544803..ff2bbaaf 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -103,7 +103,9 @@ (lambda () (copy-port (current-input-port) (current-output-port)))))) (for ([style-file (in-list all-style-files)]) - (install-file style-file))) + (if (bytes? style-file) + (display style-file) + (install-file style-file)))) (when whole-doc? (printf "\\begin{document}\n\\preDoc\n") (when (part-title-content d) diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl index baefb3fa..07a5fcf1 100644 --- a/collects/scribblings/scribble/core.scrbl +++ b/collects/scribblings/scribble/core.scrbl @@ -1383,11 +1383,14 @@ script alternative to the element content.} @defstruct[css-addition ([path (or/c path-string? - (cons/c 'collects (listof bytes?)))])]{ + (cons/c 'collects (listof bytes?)) + bytes?)])]{ -Used as a @tech{style property} to supply a CSS file to be referenced -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. +Used as a @tech{style property} to supply a CSS file (if @racket[path] +is a path, string, or list) or content (if @racket[path] is a byte +string) to be referenced or included 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. The @racket[path] field can be a result of @racket[path->main-collects-relative].} @@ -1421,12 +1424,14 @@ Like @racket[latex-defaults], but use for the @defstruct[tex-addition ([path (or/c path-string? - (cons/c 'collects (listof bytes?)))])]{ + (cons/c 'collects (listof bytes?)) + bytes?)])]{ -Used as a @tech{style property} to supply a @filepath{.tex} file to be -included in the generated Latex. This property can be attached to any -style, and all additions are collected to the top of the generated -Latex file. +Used as a @tech{style property} to supply a @filepath{.tex} file (if +@racket[path] is a path, string, or list) or content (if @racket[path] +is a byte string) to be included in the generated Latex. This property +can be attached to any style, and all additions are collected to the +top of the generated Latex file. The @racket[path] field can be a result of @racket[path->main-collects-relative].}