commit 34f12bcd597afcc3d3fb8cd646bf7a8537f17e05
parent a9141a3c3d37ec836cdcf21e500d717985375997
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Mon, 18 Feb 2013 11:12:33 -0700
scribble: preserve order of ".js", ".css", and ".tex" additions
original commit: 08604b027740e515d69b677d8542eb45fc8791b2
Diffstat:
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/collects/scribble/base-render.rkt b/collects/scribble/base-render.rkt
@@ -118,9 +118,9 @@
;; ----------------------------------------
- (define/public (extract-part-style-files d ri tag stop-at-part? pred extract)
+ (define/public (extract-part-style-files d ri stop-at-part? pred extract)
(let ([ht (make-hash)])
- (let loop ([p d][up? #t][only-up? #f])
+ (let loop ([p d] [up? #t] [only-up? #f])
(let ([s (part-style p)])
(when up?
(let ([p (collected-info-parent (part-collected-info p ri))])
@@ -137,14 +137,19 @@
(unless (stop-at-part? p)
(loop p #f #f)))
(part-parts p)))))
- (for/list ([k (in-hash-keys ht)]) (if (or (bytes? k) (url? k))
- k
- (main-collects-relative->path k)))))
+ (map cdr
+ (sort
+ (for/list ([(k v) (in-hash ht)])
+ (cons v (if (or (bytes? k) (url? k))
+ k
+ (main-collects-relative->path k))))
+ <
+ #:key car))))
(define/private (extract-style-style-files s ht pred extract)
(for ([v (in-list (style-properties s))])
(when (pred v)
- (hash-set! ht (extract v) #t))))
+ (hash-update! ht (extract v) values (hash-count ht)))))
(define/private (extract-flow-style-files blocks d ri ht pred extract)
(for ([b (in-list blocks)])
diff --git a/collects/scribble/html-render.rkt b/collects/scribble/html-render.rkt
@@ -704,7 +704,6 @@
(append (extract-part-style-files
d
ri
- 'css
(lambda (p) (part-whole-page? p ri))
css-addition?
css-addition-path)
@@ -720,7 +719,6 @@
(extract-part-style-files
d
ri
- 'css
(lambda (p) (part-whole-page? p ri))
js-addition?
js-addition-path))
diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt
@@ -89,7 +89,6 @@
(append (extract-part-style-files
d
ri
- 'tex
(lambda (p) #f)
tex-addition?
tex-addition-path)