|
|
|
@ -42,15 +42,22 @@
|
|
|
|
|
(cons `(meta "here" ,inner-here) meta-elements)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; set up the 'main export
|
|
|
|
|
(require pollen/decode)
|
|
|
|
|
(require (only-in racket/list filter-not))
|
|
|
|
|
(define here-ext (car (regexp-match #px"\\w+$" inner-here-path)))
|
|
|
|
|
(define wants-decoder? (member here-ext (list "pd" "ptree")))
|
|
|
|
|
(define main (apply (if wants-decoder?
|
|
|
|
|
;(print (cdr main-without-metas))
|
|
|
|
|
(define main (apply (cond
|
|
|
|
|
[(equal? here-ext "ptree") (λ xs (decode (cons 'ptree-root xs)
|
|
|
|
|
#:xexpr-elements-proc (λ(xs) (filter-not whitespace? xs))))]
|
|
|
|
|
;; 'root is the hook for the decoder function.
|
|
|
|
|
;; If it's not a defined identifier, it just hits #%top and becomes `(root ,@body ...)
|
|
|
|
|
root
|
|
|
|
|
[wants-decoder? root]
|
|
|
|
|
;; for preprocessor output, just make a string. Converts x-expressions to HTML.
|
|
|
|
|
(λ xs (apply string-append (map (dynamic-require 'xml 'xexpr->string) xs))))
|
|
|
|
|
[else (λ xs (apply string-append (map (dynamic-require 'xml 'xexpr->string) xs)))])
|
|
|
|
|
(cdr main-without-metas))) ;; cdr strips placeholder-root tag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|