studying reload

pull/9/head
Matthew Butterick 11 years ago
parent c942f5b74a
commit 402a3bb12d

@ -3,8 +3,18 @@
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(require pollen/lang/inner-lang-helper)
(define-syntax-rule (new-module-begin body-exprs ...)
(#%module-begin
; this is here only so that dynamic-rerequire of a pollen module
; transitively reloads the extras also.
; if this isn't here, then dynamic-rerequire can't see them
; and thus they are not tracked for changes.
(require-project-require-files)
(module inner pollen/lang/doclang-raw
;; doclang_raw is a version of scribble/doclang with the decoder disabled
;; first three lines are positional arguments for doclang-raw

@ -118,12 +118,17 @@
(render-through-eval `(begin (require pollen/cache)(cached-require ,source-path ',world:main-pollen-export))))))
(require racket/rerequire)
(define/contract (render-markup-source source-path [maybe-template-path #f])
((complete-path?) ((or/c #f complete-path?)) . ->* . bytes?)
(match-define-values (source-dir _ _) (split-path source-path))
(define template-path (or maybe-template-path (get-template-for source-path)))
(render-for-dev-server template-path) ; because template might have its own preprocessor source
(displayln "REREQ!")
(dynamic-rerequire (string->path "/Users/mb/git/bpt/pollen-require/bpt-elements.rkt"))
(define expr-to-eval
`(begin
(require (for-syntax racket/base))
@ -200,7 +205,7 @@
pollen/tools
pollen/world
pollen/project-requires)
(require-project-require-files)
; (require-project-require-files)
(define-namespace-anchor my-module-cache-ns-anchor)
(provide my-module-cache-ns-anchor))
@ -236,5 +241,5 @@
pollen/tools
pollen/world
pollen/project-requires
,@(get-project-require-files)))
))
(string->bytes/utf-8 (eval expr-to-eval (current-namespace)))))
Loading…
Cancel
Save