pull/9/head
Matthew Butterick 11 years ago
parent a0e8bc928c
commit dc3da688b3

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/contract racket/path) (require racket/contract racket/path)
(require (only-in racket/path filename-extension)) (require (only-in racket/path filename-extension))
(require "world.rkt" "readability.rkt") (require "world.rkt" sugar)
(provide (contract-out (provide (contract-out
[sourceish? (any/c . -> . boolean?)] [sourceish? (any/c . -> . boolean?)]

@ -5,12 +5,12 @@
;; and cached for the benefit of the render eval function. ;; and cached for the benefit of the render eval function.
(require pollen/top (require pollen/top
(only-in pollen/readability ->list) (only-in sugar ->list)
(only-in pollen/tools trim) (only-in pollen/tools trim)
(only-in pollen/predicates whitespace?)) (only-in pollen/predicates whitespace?))
(provide (all-from-out (provide (all-from-out
pollen/top pollen/top
pollen/readability sugar
pollen/tools pollen/tools
pollen/predicates)) pollen/predicates))

@ -1,6 +1,6 @@
#lang racket/base #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) (provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [module-begin #%module-begin])) (rename-out [module-begin #%module-begin]))

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/contract racket/match racket/list xml racket/set) (require racket/contract racket/match racket/list xml racket/set)
(require (prefix-in html: "library/html.rkt")) (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)) (module+ test (require rackunit))

@ -1,6 +1,6 @@
#lang racket/base #lang racket/base
(require racket/port racket/file racket/rerequire racket/contract) (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)) (module+ test (require rackunit))
@ -295,7 +295,7 @@
pollen/main-preproc-imports pollen/main-preproc-imports
pollen/predicates pollen/predicates
pollen/ptree pollen/ptree
pollen/readability sugar
pollen/template pollen/template
pollen/tools pollen/tools
pollen/world) pollen/world)
@ -326,7 +326,7 @@
pollen/main-preproc-imports pollen/main-preproc-imports
pollen/predicates pollen/predicates
pollen/ptree pollen/ptree
pollen/readability sugar
pollen/template pollen/template
pollen/tools pollen/tools
pollen/world)) pollen/world))

@ -5,7 +5,7 @@
(require web-server/http/request-structs) (require web-server/http/request-structs)
(require web-server/http/response-structs) (require web-server/http/response-structs)
(require 2htdp/image) (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)) (module+ test (require rackunit))

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/system racket/port racket/file (require racket/system racket/port racket/file
racket/class racket/list) racket/class racket/list)
(require "debug.rkt" "readability.rkt" "world.rkt") (require "debug.rkt" sugar "world.rkt")
(provide setup) (provide setup)
@ -75,10 +75,10 @@
;; task: make polcom file ;; task: make polcom file
(define (delete-polcom-file-if-existing) (define (delete-polcom-file-if-existing)
(when (file-exists? POLLEN_COMMAND_FILE) (when (file-exists? COMMAND_FILE)
(begin (begin
(message (format "Deleting existing polcom file in ~a" cd)) (message (format "Deleting existing polcom file in ~a" cd))
(delete-file POLLEN_COMMAND_FILE)))) (delete-file COMMAND_FILE))))
(define (save-polcom-file) (define (save-polcom-file)
(define path-to-racket-exists? (> (len RACKET_PATH) 0)) (define path-to-racket-exists? (> (len RACKET_PATH) 0))
@ -90,8 +90,8 @@
(message (format "Creating new polcom file in ~a" cd)) (message (format "Creating new polcom file in ~a" cd))
(if (not (test-mode)) (if (not (test-mode))
(begin (begin
(display-to-file polcom-data POLLEN_COMMAND_FILE) (display-to-file polcom-data COMMAND_FILE)
(with-output-to-string (λ() (system (format "chmod 755 ~a" POLLEN_COMMAND_FILE))))) (with-output-to-string (λ() (system (format "chmod 755 ~a" COMMAND_FILE)))))
(message "[test mode: file would be saved now]"))) (message "[test mode: file would be saved now]")))
(begin (begin
(message "No path to Racket binary") (message "No path to Racket binary")
@ -111,7 +111,7 @@
(define (success-messages) (define (success-messages)
(message "Setup complete") (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 "Run '~a start' to start project server" path-to-polcom))
(message (format "Or run '~a help' for a list of commands" path-to-polcom)) (message (format "Or run '~a help' for a list of commands" path-to-polcom))
(when (not (test-mode)) (exit))) (when (not (test-mode)) (exit)))

@ -1,6 +1,6 @@
#lang racket/base #lang racket/base
(require racket/contract racket/string xml xml/path racket/bool) (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 ;; setup for test cases
(module+ test (require rackunit racket/path)) (module+ test (require rackunit racket/path))
@ -117,15 +117,5 @@
(define ->html put-as-html) (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 ...))) "")]))

@ -5,8 +5,8 @@
(require (only-in racket/string string-join)) (require (only-in racket/string string-join))
(require (only-in xml xexpr? xexpr/c)) (require (only-in xml xexpr? xexpr/c))
(require "readability.rkt" "debug.rkt" "predicates.rkt" "world.rkt") (require sugar "debug.rkt" "predicates.rkt" "world.rkt")
(provide (all-defined-out) (all-from-out "readability.rkt" "debug.rkt" "predicates.rkt" racket/list racket/path)) (provide (all-defined-out) (all-from-out sugar "debug.rkt" "predicates.rkt" racket/list racket/path))
;; setup for test cases ;; setup for test cases
(module+ test (require rackunit)) (module+ test (require rackunit))

@ -41,7 +41,7 @@
(define COMMAND_FILE "polcom") (define COMMAND_FILE "polcom")
(require "readability.rkt") (require sugar)
(define RESERVED_PATHS (define RESERVED_PATHS
(map ->path (list COMMAND_FILE EXTRAS_DIR "poldash.css" "compiled"))) (map ->path (list COMMAND_FILE EXTRAS_DIR "poldash.css" "compiled")))

Loading…
Cancel
Save