pull/9/head
Matthew Butterick 11 years ago
parent 5746b2c27d
commit 59b7343611

@ -22,7 +22,7 @@
(datum->syntax file-contents (datum->syntax file-contents
`(module pollen-lang-module pollen `(module pollen-lang-module pollen
(define reader-mode ',reader-mode) (define reader-mode ',reader-mode)
(define here-path ,(if (symbol? path-string) (symbol->string path-string) (path->string path-string))) (define reader-here-path ,(if (symbol? path-string) (symbol->string path-string) (path->string path-string)))
,(require+provide-project-require-files path-string) ,(require+provide-project-require-files path-string)
,@file-contents) ,@file-contents)
file-contents))) file-contents)))

@ -49,10 +49,12 @@
(define metas (make-hash (map meta-element->assoc meta-elements))) (define metas (make-hash (map meta-element->assoc meta-elements)))
(values doc-without-metas metas)) (values doc-without-metas metas))
;; if reader-here-path is undefined, it will become a proc courtesy of #%top ;; if reader-here-path is undefined, it will become a proc courtesy of #%top
;; therefore that's how we can detect if it's undefined ;; therefore that's how we can detect if it's undefined
(define here-path (if (procedure? reader-here-path) "anonymous-module" reader-here-path)) (define here-path (if (procedure? reader-here-path) "anonymous-module" reader-here-path))
(define doc-txexpr (define doc-txexpr
(let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown) (let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown)
(apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw) (apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw)

Loading…
Cancel
Save