updates
parent
139af0a22f
commit
db44ef7eff
@ -0,0 +1 @@
|
||||
world 10201
|
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
@ -1,22 +1,36 @@
|
||||
#lang racket/base
|
||||
(require racket/list racket/set)
|
||||
(require "readability.rkt" "file-tools.rkt" "world.rkt")
|
||||
(require "readability.rkt" "file-tools.rkt" "world.rkt" "debug.rkt")
|
||||
|
||||
|
||||
(define (pd which)
|
||||
(->path (format "/Users/MB/git/~a" which)))
|
||||
(->path (format "/Users/MB/git/pollen/~a" which)))
|
||||
|
||||
|
||||
(define (ineligible-path? f)
|
||||
(or (not (visible? f)) (member f RESERVED_PATHS)))
|
||||
|
||||
(define (unique-members xs)
|
||||
(set->list (list->set xs)))
|
||||
|
||||
(define (route-index [dir pollen-project-directory])
|
||||
(define unique-eligible-paths
|
||||
(unique-members (map ->output-path
|
||||
(filter-not ineligible-path? (directory-list dir)))))
|
||||
unique-eligible-paths)
|
||||
(define (make-link-cell [href+text (cons #f #f)])
|
||||
(define href (car href+text))
|
||||
(define text (cdr href+text))
|
||||
(filter-not void? `(td ,(when (and href text)
|
||||
`(a ((href ,href)) ,text)))))
|
||||
|
||||
(define (make-path-row p)
|
||||
(define pstring (->string p))
|
||||
(define (file-in-dir? p) (file-exists? (apply build-path (map ->path (list dir p)))))
|
||||
(define sources (filter file-in-dir? (list (->preproc-source-path pstring) (->pollen-source-path pstring))))
|
||||
`(tr ,@(map make-link-cell (list
|
||||
(cons pstring pstring)
|
||||
(cons (format "raw/~a" pstring) "raw")
|
||||
(if (not (empty? sources))
|
||||
(cons (->string (car sources)) "source")
|
||||
(cons #f #f))))))
|
||||
|
||||
(define (unique-sorted-paths xs)
|
||||
(sort (set->list (list->set (map ->output-path xs))) #:key ->string string<?))
|
||||
|
||||
(define (ineligible-path? x) (or (not (visible? x)) (member x RESERVED_PATHS)))
|
||||
|
||||
(define project-paths (filter-not ineligible-path? (directory-list dir)))
|
||||
`(table ,@(map make-path-row (unique-sorted-paths project-paths))))
|
||||
|
||||
(route-index (pd "foobar"))
|
Loading…
Reference in New Issue