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
This commit is contained in:
parent
8f7ca80e7d
commit
54a1dbc33f
|
@ -6,7 +6,7 @@
|
|||
mzlib/serialize
|
||||
scheme/file
|
||||
scheme/path
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
setup/path-relativize
|
||||
file/convertible
|
||||
net/url-structs
|
||||
|
@ -142,7 +142,7 @@
|
|||
(for/list ([(k v) (in-hash ht)])
|
||||
(cons v (if (or (bytes? k) (url? k))
|
||||
k
|
||||
(main-collects-relative->path k))))
|
||||
(collects-relative->path k))))
|
||||
<
|
||||
#:key car))))
|
||||
|
||||
|
@ -751,7 +751,7 @@
|
|||
(style-properties (part-style d)))])
|
||||
(when extras
|
||||
(for ([fn (in-list (auto-extra-files-paths extras))])
|
||||
(install-file (main-collects-relative->path fn)
|
||||
(install-file (collects-relative->path fn)
|
||||
#:private-name? #f)))))))
|
||||
|
||||
(define/public (render ds fns ri)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
file/convertible
|
||||
mzlib/runtime-path
|
||||
setup/main-doc
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
setup/dirs
|
||||
net/url
|
||||
net/uri-codec
|
||||
|
@ -259,7 +259,7 @@
|
|||
(define (path->relative p)
|
||||
(let ([p (path->main-doc-relative p)])
|
||||
(if (path? p)
|
||||
(let ([p (path->main-collects-relative p)])
|
||||
(let ([p (path->collects-relative p)])
|
||||
(if (path? p)
|
||||
(path->root-relative p)
|
||||
(intern-taglet p)))
|
||||
|
@ -274,7 +274,7 @@
|
|||
p)])
|
||||
(if (path? p)
|
||||
p
|
||||
(main-collects-relative->path p)))))
|
||||
(collects-relative->path p)))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
@ -711,14 +711,14 @@
|
|||
(let ([v (html-defaults-prefix-path defaults)])
|
||||
(if (bytes? v)
|
||||
v
|
||||
(main-collects-relative->path v))))
|
||||
(collects-relative->path v))))
|
||||
scribble-prefix-html)]
|
||||
[style-file (or style-file
|
||||
(and defaults
|
||||
(let ([v (html-defaults-style-path defaults)])
|
||||
(if (bytes? v)
|
||||
v
|
||||
(main-collects-relative->path v))))
|
||||
(collects-relative->path v))))
|
||||
scribble-style-css)]
|
||||
[script-file (or script-file scribble-js)]
|
||||
[title (cond [(part-title-content d)
|
||||
|
@ -1097,7 +1097,7 @@
|
|||
[width ,(number->string w)]
|
||||
[height ,(number->string h)])))))]
|
||||
[(image-element? e)
|
||||
(let* ([src (main-collects-relative->path (image-element-path e))]
|
||||
(let* ([src (collects-relative->path (image-element-path e))]
|
||||
[suffixes (image-element-suffixes e)]
|
||||
[scale (image-element-scale e)]
|
||||
[to-num
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#lang scheme/base
|
||||
(require setup/main-collects
|
||||
(require setup/collects
|
||||
scribble/core
|
||||
(except-in scribble/base author)
|
||||
scribble/decode
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
(define jfp-extras
|
||||
(let ([abs (lambda (s)
|
||||
(path->main-collects-relative
|
||||
(path->collects-relative
|
||||
(collection-file-path s "scribble" "jfp")))])
|
||||
(list
|
||||
(make-css-addition (abs "jfp.css"))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
(require scribble/doclang
|
||||
(except-in scribble/base author)
|
||||
scribble/jfp
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
"../private/defaults.rkt"
|
||||
net/ftp
|
||||
racket/file
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
(define cls-file
|
||||
(let ([p (scribble-file "jfp/jfp1.cls")])
|
||||
(if (file-exists? (main-collects-relative->path p))
|
||||
(if (file-exists? (collects-relative->path p))
|
||||
p
|
||||
(downloaded-file "jfp1.cls"))))
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
racket/port
|
||||
racket/string
|
||||
racket/list
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
file/convertible)
|
||||
(provide render-mixin
|
||||
make-render-part-mixin)
|
||||
|
@ -76,14 +76,14 @@
|
|||
(let ([v (latex-defaults-prefix defaults)])
|
||||
(cond
|
||||
[(bytes? v) v]
|
||||
[else (main-collects-relative->path v)])))
|
||||
[else (collects-relative->path v)])))
|
||||
scribble-prefix-tex)]
|
||||
[style-file (or style-file
|
||||
(and defaults
|
||||
(let ([v (latex-defaults-style defaults)])
|
||||
(cond
|
||||
[(bytes? v) v]
|
||||
[else (main-collects-relative->path v)])))
|
||||
[else (collects-relative->path v)])))
|
||||
scribble-style-tex)]
|
||||
[all-style-files (cons scribble-tex
|
||||
(append (extract-part-style-files
|
||||
|
@ -330,7 +330,7 @@
|
|||
(check-render)
|
||||
(let ([fn (install-file
|
||||
(select-suffix
|
||||
(main-collects-relative->path
|
||||
(collects-relative->path
|
||||
(image-element-path e))
|
||||
(image-element-suffixes e)
|
||||
'(".pdf" ".ps" ".png")))])
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
(prefix-in s/b: scribble/base)
|
||||
scribble/decode
|
||||
"../private/defaults.rkt"
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
scribble/html-properties
|
||||
scribble/latex-properties
|
||||
scribble/latex-prefix
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
(define cls-file
|
||||
(let ([p (scribble-file "lncs/llncs.cls")])
|
||||
(if (file-exists? (main-collects-relative->path p))
|
||||
(if (file-exists? (collects-relative->path p))
|
||||
p
|
||||
(downloaded-file "llncs.cls"))))
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
(define lncs-extras
|
||||
(let ([abs (lambda (s)
|
||||
(path->main-collects-relative
|
||||
(path->collects-relative
|
||||
(collection-file-path s "scribble" "lncs")))])
|
||||
(list
|
||||
(make-css-addition (abs "lncs.css"))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scheme/base
|
||||
(require scribble/core
|
||||
scribble/latex-properties
|
||||
setup/main-collects)
|
||||
setup/collects)
|
||||
|
||||
(provide scribble-file
|
||||
downloaded-file
|
||||
|
@ -13,7 +13,7 @@
|
|||
(cons new properties)))
|
||||
|
||||
(define (scribble-file s)
|
||||
(path->main-collects-relative (collection-file-path s "scribble")))
|
||||
(path->collects-relative (collection-file-path s "scribble")))
|
||||
|
||||
(define (downloaded-file s)
|
||||
(build-path (find-system-path 'addon-dir) s))
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
(require "../html-properties.rkt"
|
||||
"../latex-properties.rkt"
|
||||
"on-demand.rkt"
|
||||
setup/main-collects)
|
||||
setup/collects)
|
||||
|
||||
(provide scheme-properties)
|
||||
|
||||
(define-on-demand scheme-properties
|
||||
(let ([abs (lambda (s)
|
||||
(path->main-collects-relative (collection-file-path s "scribble")))])
|
||||
(path->collects-relative (collection-file-path s "scribble")))])
|
||||
(list (make-css-addition (abs "racket.css"))
|
||||
(make-tex-addition (abs "racket.tex")))))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#lang scheme/base
|
||||
(require setup/main-collects
|
||||
(require setup/collects
|
||||
racket/contract/base
|
||||
scribble/core
|
||||
scribble/base
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
(define sigplan-extras
|
||||
(let ([abs (lambda (s)
|
||||
(path->main-collects-relative
|
||||
(path->collects-relative
|
||||
(collection-file-path s "scribble" "sigplan")))])
|
||||
(list
|
||||
(make-css-addition (abs "sigplan.css"))
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
(define (get-docs)
|
||||
(list (quote-syntax (req ... ...))
|
||||
(quote-syntax (expr ...))
|
||||
(quote-syntax/keep-srcloc doc-body))))))
|
||||
(quote-syntax/keep-srcloc #:source 'doc doc-body))))))
|
||||
;; normal mode: return an identifier that holds the document:
|
||||
(with-syntax ([((id d) ...) #'doc-body])
|
||||
#'(begin-for-syntax
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang racket/base
|
||||
(require racket/contract/base
|
||||
syntax/modcollapse
|
||||
setup/main-collects
|
||||
setup/collects
|
||||
scribble/core
|
||||
;; Needed to normalize planet version numbers:
|
||||
(only-in planet/resolver get-planet-module-path/pkg)
|
||||
|
@ -66,7 +66,7 @@
|
|||
(module-path-index-resolve mod))])
|
||||
(if (path? rp)
|
||||
(intern-taglet
|
||||
(path->main-collects-relative rp))
|
||||
(path->collects-relative rp))
|
||||
rp))
|
||||
(let ([p (if (and (pair? p)
|
||||
(eq? (car p) 'planet))
|
||||
|
|
Loading…
Reference in New Issue
Block a user