|
|
@ -27,10 +27,7 @@
|
|
|
|
[files (map remove-ext (filter (λ(x) (has-ext? x POLLEN_SOURCE_EXT)) files))])
|
|
|
|
[files (map remove-ext (filter (λ(x) (has-ext? x POLLEN_SOURCE_EXT)) files))])
|
|
|
|
;; make a POLLEN_TREE_ROOT_NAME structure and convert it to a full ptree
|
|
|
|
;; make a POLLEN_TREE_ROOT_NAME structure and convert it to a full ptree
|
|
|
|
(message "Generating ptree from file listing")
|
|
|
|
(message "Generating ptree from file listing")
|
|
|
|
(ptree-root->ptree (cons POLLEN_TREE_ROOT_NAME (map path->string files))))))
|
|
|
|
(ptree-root->ptree (cons POLLEN_TREE_ROOT_NAME (map path->pnode files))))))
|
|
|
|
|
|
|
|
|
|
|
|
(define project-ptree (make-project-ptree))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; remove parents from tree (i.e., just remove attrs)
|
|
|
|
;; remove parents from tree (i.e., just remove attrs)
|
|
|
|
;; is not the inverse of add-parents, i.e., you do not get back your original input.
|
|
|
|
;; is not the inverse of add-parents, i.e., you do not get back your original input.
|
|
|
@ -218,16 +215,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
;; convert path to pnode
|
|
|
|
;; convert path to pnode
|
|
|
|
;; used for converting "here" values to pnodes
|
|
|
|
;; used for converting "here" values to pnodes
|
|
|
|
(define/contract (here->pnode x)
|
|
|
|
(define/contract (path->pnode x)
|
|
|
|
(pathish? . -> . pnode?)
|
|
|
|
(pathish? . -> . pnode?)
|
|
|
|
(->string (remove-all-ext (last (explode-path (->path x))))))
|
|
|
|
(->string (remove-all-ext (last (explode-path (->path x))))))
|
|
|
|
|
|
|
|
|
|
|
|
(module+ test
|
|
|
|
(module+ test
|
|
|
|
(check-equal? (here->pnode "bar") "bar")
|
|
|
|
(check-equal? (path->pnode "bar") "bar")
|
|
|
|
(check-equal? (here->pnode "foo/bar") "bar")
|
|
|
|
(check-equal? (path->pnode "foo/bar") "bar")
|
|
|
|
(check-equal? (here->pnode "foo/bar.html") "bar")
|
|
|
|
(check-equal? (path->pnode "foo/bar.html") "bar")
|
|
|
|
(check-equal? (here->pnode "/Users/this/that/foo/bar.html.pp") "bar"))
|
|
|
|
(check-equal? (path->pnode "/Users/this/that/foo/bar.html.pp") "bar"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define here->pnode path->pnode)
|
|
|
|
|
|
|
|
|
|
|
|
;; convert key to URL
|
|
|
|
;; convert key to URL
|
|
|
|
;; = key name + suffix of template (or suffix of default template)
|
|
|
|
;; = key name + suffix of template (or suffix of default template)
|
|
|
@ -237,3 +235,7 @@
|
|
|
|
(pnode? . -> . string?)
|
|
|
|
(pnode? . -> . string?)
|
|
|
|
(string-append key ".html"))
|
|
|
|
(string-append key ".html"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; this project setup must follow definitions to prevent undefined errors
|
|
|
|
|
|
|
|
(define project-ptree (make-project-ptree))
|
|
|
|
|
|
|
|
|
|
|
|