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