dashboard updates

pull/9/head
Matthew Butterick 11 years ago
parent 02c98719e8
commit 7c5c11489e

@ -86,7 +86,7 @@
;; todo: add extensions
(define binary-extensions
'(gif jpg jpeg mp3 png zip))
'(gif jpg jpeg mp3 png zip pdf ico tar ai eps))
(define/contract (has-binary-ext? x)
(pathish? . -> . boolean?)

@ -11,12 +11,17 @@ body {
table {
border-collapse:collapse;
width: 100%;
max-width: 900px;
}
tr > td:first-child {
width: 0%;
}
tr > td:first-child + td {
tr > td:first-child {
font-family: "Triplicate T4";
background: #f6f6f6;
text-align: left;
}
tr, tr + tr {
@ -25,7 +30,8 @@ tr, tr + tr {
td {
font-size: 17px;
width: 20%;
line-height: 1.35;
text-align: center;
}
a:hover {
@ -36,7 +42,11 @@ a {
text-decoration: none;
color: #6a6;
display: block;
padding: 1em;
padding: 0.5em;
}
.file-ext {
color: #bbb;
}
a:active {
@ -46,6 +56,5 @@ a:active {
tt {
font-family: "AlixFB";
font-size: 100%;
white-space: pre;
word-wrap: normal;
white-space: pre-wrap;
}

@ -109,8 +109,7 @@
(define url-to-parent (string-replace url-to-parent-dashboard DASHBOARD_NAME ""))
`(tr ,@(map make-link-cell (list
(cons url-to-parent-dashboard "")
(cons url-to-parent url-to-parent)
(cons url-to-parent-dashboard url-to-parent)
empty-cell
(cons #f "(parent dir)")
empty-cell))))
@ -125,24 +124,27 @@
(define source (and (not (empty? possible-sources)) (->string (car possible-sources))))
`(tr ,@(map make-link-cell
(append (list
;; folder traversal cell
(if (directory-exists? (build-path dir filename)) ; links subdir to its dashboard
(cons (format "~a/~a" filename DASHBOARD_NAME) "")
empty-cell)
(cons filename filename) ; main cell
(if source ; source cell (if needed)
(cons (format "raw/~a" source) (format "~a source" (get-ext source)))
empty-cell)
(cond ;; main cell
[(directory-exists? (build-path dir filename)) ; links subdir to its dashboard
(cons (format "~a/~a" filename DASHBOARD_NAME) (format "~a/" filename))]
[source (cons #f `(a ((href ,filename)) ,filename (span ((class "file-ext")) "." ,(get-ext source))))]
[else (cons filename filename)])
(cond ; source cell (if needed)
[(has-ext? filename POLLEN_TREE_EXT) (cons (format "raw/~a" filename) "ptree")]
[source (cons (format "raw/~a" source) "in")]
[else empty-cell])
(cond ; raw cell (if needed)
[(directory-exists? (build-path dir filename)) (cons #f "(subdir)")]
[(directory-exists? (build-path dir filename)) (cons #f #f)]
[(has-binary-ext? filename) (cons #f "(binary)")]
[else (cons (format "raw/~a" filename) "output")]))
(if source
[(has-ext? filename POLLEN_TREE_EXT) empty-cell]
[else (cons (format "raw/~a" filename) "out")]))
#|(if source
(list
(if (has-ext? source POLLEN_DECODER_EXT) ; xexpr cell for pollen decoder files
(cons (format "xexpr/~a" source) "xexpr")
empty-cell))
(make-list 1 empty-cell))))))
(make-list 1 empty-cell))|#))))
(define (ineligible-path? x) (or (not (visible? x)) (member x RESERVED_PATHS)))
(define project-paths (filter-not ineligible-path? (directory-list dir)))

@ -6,6 +6,12 @@
(define POLLEN_PREPROC_EXT 'p)
(define POLLEN_DECODER_EXT 'pd)
(define POLLEN_TREE_EXT 'ptree)
(define DEFAULT_POLLEN_TREE "main.ptree")
(define POLLEN_TREE_PARENT_NAME 'parent)
(define POLLEN_TREE_ROOT_NAME 'ptree-root)
(define TEMPLATE_FILE_PREFIX "-")
(define POLLEN_EXPRESSION_DELIMITER #\◊)
(define TEMPLATE_FIELD_DELIMITER POLLEN_EXPRESSION_DELIMITER)
@ -14,10 +20,6 @@
(define FALLBACK_TEMPLATE_NAME "-temp-fallback-template.html")
(define TEMPLATE_META_KEY "template")
(define POLLEN_TREE_EXT 'ptree)
(define DEFAULT_POLLEN_TREE "main.ptree")
(define POLLEN_TREE_PARENT_NAME 'parent)
(define POLLEN_TREE_ROOT_NAME 'ptree-root)
(define MAIN_POLLEN_EXPORT 'main)
;(define META_POLLEN_TAG 'metas)
@ -43,7 +45,7 @@
(require "readability.rkt")
(define RESERVED_PATHS
(map ->path (list POLLEN_COMMAND_FILE EXTRAS_DIR "poldash.css")))
(map ->path (list POLLEN_COMMAND_FILE EXTRAS_DIR "poldash.css" "compiled")))
(define PROJECT_ROOT (current-directory))

Loading…
Cancel
Save