diff --git a/file-tools.rkt b/file-tools.rkt index 13db15d..b92b346 100644 --- a/file-tools.rkt +++ b/file-tools.rkt @@ -1,7 +1,7 @@ #lang racket/base (require racket/contract racket/path) (require (only-in racket/path filename-extension)) -(require "world.rkt" "readability.rkt") +(require "world.rkt" sugar) (provide (contract-out [sourceish? (any/c . -> . boolean?)] diff --git a/main-preproc-imports.rkt b/main-preproc-imports.rkt index c558383..12d7798 100644 --- a/main-preproc-imports.rkt +++ b/main-preproc-imports.rkt @@ -5,12 +5,12 @@ ;; and cached for the benefit of the render eval function. (require pollen/top - (only-in pollen/readability ->list) + (only-in sugar ->list) (only-in pollen/tools trim) (only-in pollen/predicates whitespace?)) (provide (all-from-out pollen/top - pollen/readability + sugar pollen/tools pollen/predicates)) \ No newline at end of file diff --git a/main-preproc.rkt b/main-preproc.rkt index 0f458dc..7136345 100644 --- a/main-preproc.rkt +++ b/main-preproc.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require "main-preproc-imports.rkt" "readability.rkt") +(require "main-preproc-imports.rkt" sugar) (provide (except-out (all-from-out racket/base) #%module-begin) (rename-out [module-begin #%module-begin])) diff --git a/predicates.rkt b/predicates.rkt index 930ad6e..a493c64 100644 --- a/predicates.rkt +++ b/predicates.rkt @@ -1,7 +1,7 @@ #lang racket/base (require racket/contract racket/match racket/list xml racket/set) (require (prefix-in html: "library/html.rkt")) -(require "world.rkt" "readability.rkt" "file-tools.rkt" "debug.rkt") +(require "world.rkt" sugar "file-tools.rkt" "debug.rkt") (module+ test (require rackunit)) diff --git a/render.rkt b/render.rkt index 0692e30..67d8542 100644 --- a/render.rkt +++ b/render.rkt @@ -1,6 +1,6 @@ #lang racket/base (require racket/port racket/file racket/rerequire racket/contract) -(require "world.rkt" "tools.rkt" "readability.rkt" "template.rkt") +(require "world.rkt" "tools.rkt" "template.rkt") (module+ test (require rackunit)) @@ -295,7 +295,7 @@ pollen/main-preproc-imports pollen/predicates pollen/ptree - pollen/readability + sugar pollen/template pollen/tools pollen/world) @@ -326,7 +326,7 @@ pollen/main-preproc-imports pollen/predicates pollen/ptree - pollen/readability + sugar pollen/template pollen/tools pollen/world)) diff --git a/server-routes.rkt b/server-routes.rkt index 1c99484..cb8e0b2 100644 --- a/server-routes.rkt +++ b/server-routes.rkt @@ -5,7 +5,7 @@ (require web-server/http/request-structs) (require web-server/http/response-structs) (require 2htdp/image) -(require "world.rkt" "render.rkt" "readability.rkt" "predicates.rkt" "debug.rkt" "ptree.rkt") +(require "world.rkt" "render.rkt" sugar "predicates.rkt" "debug.rkt" "ptree.rkt") (module+ test (require rackunit)) diff --git a/setup.rkt b/setup.rkt index 15f77d3..b997bda 100644 --- a/setup.rkt +++ b/setup.rkt @@ -1,7 +1,7 @@ #lang racket/base (require racket/system racket/port racket/file racket/class racket/list) -(require "debug.rkt" "readability.rkt" "world.rkt") +(require "debug.rkt" sugar "world.rkt") (provide setup) @@ -75,10 +75,10 @@ ;; task: make polcom file (define (delete-polcom-file-if-existing) - (when (file-exists? POLLEN_COMMAND_FILE) + (when (file-exists? COMMAND_FILE) (begin (message (format "Deleting existing polcom file in ~a" cd)) - (delete-file POLLEN_COMMAND_FILE)))) + (delete-file COMMAND_FILE)))) (define (save-polcom-file) (define path-to-racket-exists? (> (len RACKET_PATH) 0)) @@ -90,8 +90,8 @@ (message (format "Creating new polcom file in ~a" cd)) (if (not (test-mode)) (begin - (display-to-file polcom-data POLLEN_COMMAND_FILE) - (with-output-to-string (λ() (system (format "chmod 755 ~a" POLLEN_COMMAND_FILE))))) + (display-to-file polcom-data COMMAND_FILE) + (with-output-to-string (λ() (system (format "chmod 755 ~a" COMMAND_FILE))))) (message "[test mode: file would be saved now]"))) (begin (message "No path to Racket binary") @@ -111,7 +111,7 @@ (define (success-messages) (message "Setup complete") - (define path-to-polcom (format "~a~a" cd POLLEN_COMMAND_FILE)) + (define path-to-polcom (format "~a~a" cd COMMAND_FILE)) (message (format "Run '~a start' to start project server" path-to-polcom)) (message (format "Or run '~a help' for a list of commands" path-to-polcom)) (when (not (test-mode)) (exit))) diff --git a/template.rkt b/template.rkt index f83a4c8..92ed858 100644 --- a/template.rkt +++ b/template.rkt @@ -1,6 +1,6 @@ #lang racket/base (require racket/contract racket/string xml xml/path racket/bool) -(require "tools.rkt" "ptree.rkt") +(require "tools.rkt" "ptree.rkt" sugar/scribble) ;; setup for test cases (module+ test (require rackunit racket/path)) @@ -117,15 +117,5 @@ (define ->html put-as-html) -;; improves the syntax for conditional blocks in templates -;; ordinarily it would be ◊when[condition]{◊list{stuff ...}} -;; now it can be ◊when/block[condition]{stuff ...} -;; has to be a macro otherwise body expressions will be evaluated regardless of condition -;; this is bad: if condition is false, expression should exit -(require (for-syntax racket/base)) -(define-syntax (when/block stx) - (syntax-case stx () - [(_ condition body ...) - #'(if condition (string-append* (map ->string (list body ...))) "")])) diff --git a/tools.rkt b/tools.rkt index 9fcfe04..a46e420 100644 --- a/tools.rkt +++ b/tools.rkt @@ -5,8 +5,8 @@ (require (only-in racket/string string-join)) (require (only-in xml xexpr? xexpr/c)) -(require "readability.rkt" "debug.rkt" "predicates.rkt" "world.rkt") -(provide (all-defined-out) (all-from-out "readability.rkt" "debug.rkt" "predicates.rkt" racket/list racket/path)) +(require sugar "debug.rkt" "predicates.rkt" "world.rkt") +(provide (all-defined-out) (all-from-out sugar "debug.rkt" "predicates.rkt" racket/list racket/path)) ;; setup for test cases (module+ test (require rackunit)) diff --git a/world.rkt b/world.rkt index f7593ac..8c61157 100644 --- a/world.rkt +++ b/world.rkt @@ -41,7 +41,7 @@ (define COMMAND_FILE "polcom") -(require "readability.rkt") +(require sugar) (define RESERVED_PATHS (map ->path (list COMMAND_FILE EXTRAS_DIR "poldash.css" "compiled")))