From 8e8d13f1313fa09521a14bafa20a6a06e8d4d844 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 1 May 2014 15:26:54 -0700 Subject: [PATCH] various cosmetic tidying --- cache.rkt | 5 +---- debug.rkt | 2 +- doclang-raw.rkt | 2 +- file.rkt | 3 +++ main-base.rkt | 2 +- main.rkt | 3 ++- markdown.rkt | 1 + markup.rkt | 1 + pagetree.rkt | 2 +- pre.rkt | 1 + project.rkt | 2 +- ptree.rkt | 1 + reader-base.rkt | 1 + server-extras/poldash.css | 1 + server-routes.rkt | 2 +- server.rkt | 1 - tag.rkt | 4 +--- template.rkt | 3 +-- tmpl.rkt | 1 + top.rkt | 2 +- 20 files changed, 22 insertions(+), 18 deletions(-) diff --git a/cache.rkt b/cache.rkt index 861b915..5f3ac3f 100644 --- a/cache.rkt +++ b/cache.rkt @@ -43,7 +43,4 @@ (> (file-or-directory-modify-seconds path) (hash-ref (cache-ref path) 'mod-time))) (cache path)) - (hash-ref (cache-ref path) key)) - - - + (hash-ref (cache-ref path) key)) \ No newline at end of file diff --git a/debug.rkt b/debug.rkt index 9544f7c..5e37928 100644 --- a/debug.rkt +++ b/debug.rkt @@ -75,4 +75,4 @@ (make-message-logger-functions debug) (define+provide (message . items) - (displayln (string-join `(,@(map (λ(x)(if (string? x) x (format "~v" x))) items))))) \ No newline at end of file + (displayln (string-join `(,@(map (λ(x)(if (string? x) x (format "~v" x))) items))))) diff --git a/doclang-raw.rkt b/doclang-raw.rkt index 8e10393..a181a93 100755 --- a/doclang-raw.rkt +++ b/doclang-raw.rkt @@ -76,4 +76,4 @@ #'(check-pre-part e (vector 'src 'line 'col 'pos 'span))))])) (define (check-pre-part v s) - v) + v) \ No newline at end of file diff --git a/file.rkt b/file.rkt index 87ae0a3..7097284 100644 --- a/file.rkt +++ b/file.rkt @@ -111,6 +111,7 @@ (coerce/symbol? . -> . (listof complete-path?)) (map ->complete-path (filter (λ(i) (has-ext? i ext)) (directory-list (world:current-project-root))))) + (define+provide (racket-source? x) (->boolean (and (pathish? x) (has-ext? (->path x) 'rkt)))) @@ -119,10 +120,12 @@ (define (unsaved-source? path-string) ((substring (->string path-string) 0 7) . equal? . "unsaved")) + (define+provide (magic-directory? path) (and (directory-exists? path) (or (ends-with? (path->string path) "compiled")))) + (define+provide (pollen-related-file? file) (ormap (λ(proc) (proc file)) (list preproc-source? diff --git a/main-base.rkt b/main-base.rkt index 58430ab..a5ed125 100644 --- a/main-base.rkt +++ b/main-base.rkt @@ -113,4 +113,4 @@ (module+ main (if (or (equal? parser-mode world:mode-preproc) (equal? parser-mode world:mode-template)) (display doc) - (print doc)))))]))))])) + (print doc)))))]))))])) \ No newline at end of file diff --git a/main.rkt b/main.rkt index e8f48f1..08169e4 100644 --- a/main.rkt +++ b/main.rkt @@ -4,4 +4,5 @@ (module reader racket/base (require pollen/reader-base) - (define+provide-reader-in-mode world:mode-auto)) ; because default mode in file is auto \ No newline at end of file + ;; because default mode in file is auto + (define+provide-reader-in-mode world:mode-auto)) \ No newline at end of file diff --git a/markdown.rkt b/markdown.rkt index ed652ef..ed2cb59 100644 --- a/markdown.rkt +++ b/markdown.rkt @@ -1,5 +1,6 @@ #lang racket/base (require pollen/main-base) + (define+provide-module-begin-in-mode world:mode-markdown) (module reader racket/base diff --git a/markup.rkt b/markup.rkt index 9e29ee0..4250d0b 100644 --- a/markup.rkt +++ b/markup.rkt @@ -1,5 +1,6 @@ #lang racket/base (require pollen/main-base) + (define+provide-module-begin-in-mode world:mode-markup) (module reader racket/base diff --git a/pagetree.rkt b/pagetree.rkt index 78e976d..8e7ec0e 100644 --- a/pagetree.rkt +++ b/pagetree.rkt @@ -136,4 +136,4 @@ (define+provide/contract (in-pagetree? pnish [pt (current-pagetree)]) (((or/c #f pagenodeish?)) (pagetree?) . ->* . boolean?) - (->boolean (and pnish (member pnish (pagetree->list pt))))) + (->boolean (and pnish (member pnish (pagetree->list pt))))) \ No newline at end of file diff --git a/pre.rkt b/pre.rkt index 4d79def..2b1b8b9 100644 --- a/pre.rkt +++ b/pre.rkt @@ -1,5 +1,6 @@ #lang racket/base (require pollen/main-base) + (define+provide-module-begin-in-mode world:mode-preproc) (module reader racket/base diff --git a/project.rkt b/project.rkt index a27bb79..9b676dc 100644 --- a/project.rkt +++ b/project.rkt @@ -25,4 +25,4 @@ (define+provide (require-project-require-files here-path) - (require+provide-project-require-files here-path #:provide #f)) + (require+provide-project-require-files here-path #:provide #f)) \ No newline at end of file diff --git a/ptree.rkt b/ptree.rkt index aa5be30..7d78356 100644 --- a/ptree.rkt +++ b/ptree.rkt @@ -1,5 +1,6 @@ #lang racket/base (require pollen/main-base) + (define+provide-module-begin-in-mode world:mode-pagetree) (module reader racket/base diff --git a/reader-base.rkt b/reader-base.rkt index 365f692..72aa893 100644 --- a/reader-base.rkt +++ b/reader-base.rkt @@ -3,6 +3,7 @@ (provide define+provide-reader-in-mode (all-from-out pollen/world)) + (define (make-custom-read custom-read-syntax-proc) (λ(p) (syntax->datum diff --git a/server-extras/poldash.css b/server-extras/poldash.css index 855c888..c568025 100644 --- a/server-extras/poldash.css +++ b/server-extras/poldash.css @@ -90,6 +90,7 @@ a:active { text-decoration: underline; } + tt { font-family: "Source Code Pro"; font-size: 100%; diff --git a/server-routes.rkt b/server-routes.rkt index daf8809..9f27126 100644 --- a/server-routes.rkt +++ b/server-routes.rkt @@ -233,4 +233,4 @@ (complete-path? . -> . xexpr?) (format-as-code (~v (file->xexpr path)))) -(define route-xexpr (route-wrapper xexpr)) +(define route-xexpr (route-wrapper xexpr)) \ No newline at end of file diff --git a/server.rkt b/server.rkt index b135dcb..85bbdd9 100755 --- a/server.rkt +++ b/server.rkt @@ -12,7 +12,6 @@ (provide start-server) (define (start-server) - (define-values (pollen-servlet _) (dispatch-rules [((string-arg) ... (? pagetree-source?)) route-dashboard] diff --git a/tag.rkt b/tag.rkt index 6d8cefe..4f3b834 100644 --- a/tag.rkt +++ b/tag.rkt @@ -26,6 +26,4 @@ `(,id ,@(if (equal? attrs null) null (list (reverse attrs))) ,@body))) - (apply compose1 (map make-one-tag ids))) - - + (apply compose1 (map make-one-tag ids))) \ No newline at end of file diff --git a/template.rkt b/template.rkt index 8c2fe0e..0c89a0f 100644 --- a/template.rkt +++ b/template.rkt @@ -84,5 +84,4 @@ #'(if condition (string-append* (with-handlers ([exn:fail? (λ(exn) (error (format "within when/block, ~a" (exn-message exn))))]) (map ->string (list body ...)))) - "")])) - + "")])) \ No newline at end of file diff --git a/tmpl.rkt b/tmpl.rkt index 7eb99c3..cae7e3f 100644 --- a/tmpl.rkt +++ b/tmpl.rkt @@ -1,5 +1,6 @@ #lang racket/base (require pollen/main-base) + (define+provide-module-begin-in-mode world:mode-template) (module reader racket/base diff --git a/top.rkt b/top.rkt index 51dfbe3..e2610eb 100644 --- a/top.rkt +++ b/top.rkt @@ -23,4 +23,4 @@ [(_ x) (if (identifier-binding #'x ) #'x - #'(#%top . x))])) + #'(#%top . x))])) \ No newline at end of file