From 904d5bb8a893b8725bc22c4d8db5035e09131764 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 19 Mar 2014 09:50:08 -0700 Subject: [PATCH] updates --- render.rkt | 6 ++++-- scribblings/world.scrbl | 5 ++--- server.rkt | 14 +++++++------- world.rkt | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/render.rkt b/render.rkt index b71068a..a7317d5 100644 --- a/render.rkt +++ b/render.rkt @@ -232,7 +232,8 @@ pollen/world pollen/project-requires sugar - txexpr) + txexpr + hyphenate) (define-namespace-anchor my-module-cache-ns-anchor) (provide my-module-cache-ns-anchor)) @@ -267,5 +268,6 @@ pollen/template pollen/world sugar - txexpr)) + txexpr + hyphenate)) (string->bytes/utf-8 (eval expr-to-eval (current-namespace))))) \ No newline at end of file diff --git a/scribblings/world.scrbl b/scribblings/world.scrbl index c120090..e175a39 100644 --- a/scribblings/world.scrbl +++ b/scribblings/world.scrbl @@ -26,9 +26,8 @@ File implicitly required into every Pollen source file from its directory. #:value #t]{ A parameter that determines whether the @racket[world:pollen-require] file is checked for changes on every pass through @racket[render]. (Can be faster to turn this off if you don't need it.) Initialized to @racket[#t].} -@defparam[world:current-module-root dir path? - #:value #f]{ -A parameter that reports the path to the Pollen module. Initialized to @racket[#f], but set to a proper value when @racketmodname[pollen/server] runs.} +@defthing[world:server-extras-dir dir string? #:value "server-extras"] +Name of directory where server support files live. @defparam[world:current-server-extras-path dir path? #:value #f]{ diff --git a/server.rkt b/server.rkt index f9a3daf..b135dcb 100755 --- a/server.rkt +++ b/server.rkt @@ -1,5 +1,7 @@ -#lang web-server -(require web-server/servlet-env +#lang web-server/base + +(require racket/list racket/contract + web-server/servlet-env web-server/dispatch) (require "server-routes.rkt" "debug.rkt" @@ -28,12 +30,10 @@ (message "Ready to rock") - (world:current-module-root (apply build-path (drop-right (explode-path (current-contract-region)) 1))) - (world:current-server-extras-path (build-path (world:current-module-root) "server-extras")) + (define module-root (apply build-path (drop-right (explode-path (current-contract-region)) 1))) + (world:current-server-extras-path (build-path module-root world:server-extras-dir)) - (parameterize ([world:current-module-root (world:current-module-root)] - [world:current-server-extras-path (world:current-server-extras-path)] - [error-print-width 1000] + (parameterize ([error-print-width 1000] [current-cache (make-cache)]) (serve/servlet pollen-servlet #:port (world:current-server-port) diff --git a/world.rkt b/world.rkt index 8dbf136..88cd7f8 100644 --- a/world.rkt +++ b/world.rkt @@ -49,7 +49,7 @@ (define dashboard-css "poldash.css") -(define current-module-root (make-parameter #f)) +(define server-extras-dir "server-extras") (define current-server-extras-path (make-parameter #f)) (define check-project-requires-in-render? (make-parameter #t))