dev-langify
Matthew Butterick 6 years ago
parent 4c642a9c3b
commit a3eaf95da3

@ -48,7 +48,8 @@
[(setup:compile-cache-active path) [(setup:compile-cache-active path)
(define key (paths->key path)) (define key (paths->key path))
(define (convert-path-to-cache-record) (define (convert-path-to-cache-record)
(when (current-render-status) (when (let ([crs (current-render-source)])
(and crs (not (equal? crs path))))
(message (format "transitively loading /~a" (find-relative-path (current-project-root) path)))) (message (format "transitively loading /~a" (find-relative-path (current-project-root) path))))
(path->hash path)) (path->hash path))
(define (get-cache-record) (cache-ref! key convert-path-to-cache-record)) (define (get-cache-record) (cache-ref! key convert-path-to-cache-record))

@ -22,13 +22,6 @@
(define-syntax (mb stx) (define-syntax (mb stx)
(syntax-case stx () (syntax-case stx ()
;; preproc branch
[(_ #:source SOURCE-PATH-STRING
#:result-id RESULT-ID)
#'(#%module-begin
(splicing-syntax-parameterize ([result (make-rename-transformer #'RESULT-ID)])
(define result (cached-doc SOURCE-PATH-STRING))
(provide result)))]
;; markup / markdown branch ;; markup / markdown branch
[(_ #:source SOURCE-PATH-STRING [(_ #:source SOURCE-PATH-STRING
#:template TEMPLATE-PATH-STRING #:template TEMPLATE-PATH-STRING

@ -150,7 +150,7 @@
(message (format "rendering /~a" (message (format "rendering /~a"
(find-relative-path (current-project-root) source-path))) (find-relative-path (current-project-root) source-path)))
(match-define-values ((cons render-result _) _ real _) (match-define-values ((cons render-result _) _ real _)
(parameterize ([current-render-status source-path] (parameterize ([current-render-source source-path]
[current-poly-target (->symbol (or (get-ext output-path) [current-poly-target (->symbol (or (get-ext output-path)
(and template-path (get-ext template-path)) (and template-path (get-ext template-path))
(current-poly-target)))]) (current-poly-target)))])
@ -194,15 +194,9 @@
(delete-file (->output-path source-path)))) (delete-file (->output-path source-path))))
(define (render-preproc-source source-path . _) (define (render-preproc-source source-path . _)
(parameterize ([current-directory (->complete-path (dirname source-path))]) (parameterize ([current-directory (->complete-path (dirname source-path))]
(render-through-eval (with-syntax ([MODNAME (gensym)] [current-render-source source-path])
[SOURCE-PATH-STRING (->string source-path)]) (cached-doc (->string source-path))))
#'(begin
(module MODNAME pollen/private/render-helper
#:source SOURCE-PATH-STRING
#:result-id result)
(require 'MODNAME)
result)))))
(define (render-markup-or-markdown-source source-path [maybe-template-path #f] [maybe-output-path #f]) (define (render-markup-or-markdown-source source-path [maybe-template-path #f] [maybe-output-path #f])
(define output-path (or maybe-output-path (->output-path source-path))) (define output-path (or maybe-output-path (->output-path source-path)))

@ -101,7 +101,7 @@
(define+provide current-server-port (make-parameter (project-server-port))) (define+provide current-server-port (make-parameter (project-server-port)))
(define+provide current-server-listen-ip (make-parameter #f)) (define+provide current-server-listen-ip (make-parameter #f))
(define+provide current-render-status (make-parameter #f)) (define+provide current-render-source (make-parameter #f))
(define-settable dashboard-css "poldash.css") (define-settable dashboard-css "poldash.css")

Loading…
Cancel
Save