scribble-enhanced/pkgs/scribble-pkgs/scribble-lib/scribble/private/defaults.rkt
Matthew Flatt 54a1dbc33f misc changes to avoid absolute paths in bytecode files
In many cases, `path->collects-relative' is used instead of
`path->main-collects-relative' to generalize existing support
for collection-relative paths.

original commit: f87981f96057c26cb311e786a91229bf4a874e5b
2013-07-08 12:24:17 -06:00

33 lines
1.2 KiB
Racket

#lang scheme/base
(require scribble/core
scribble/latex-properties
setup/collects)
(provide scribble-file
downloaded-file
add-defaults)
(define (add-property properties pred new)
(if (ormap pred properties)
properties
(cons new properties)))
(define (scribble-file s)
(path->collects-relative (collection-file-path s "scribble")))
(define (downloaded-file s)
(build-path (find-system-path 'addon-dir) s))
(define (add-defaults doc pfx styl extras version?)
(struct-copy part doc [style (make-style (style-name (part-style doc))
((if version? add-property (lambda (x y z) x))
(add-property
(style-properties (part-style doc))
latex-defaults?
(make-latex-defaults
pfx
styl
extras))
document-version?
(make-document-version (version))))]))