sugar-related updates

pull/111/head
Matthew Butterick 9 years ago
parent d05148f263
commit a864030004

@ -246,7 +246,7 @@
(define starting-dir
(if (directory-exists? starting-path)
starting-path
(get-enclosing-dir starting-path)))
(dirname starting-path)))
(->output-path (find-relative-path (->complete-path starting-dir) (->complete-path path))))

@ -1,7 +1,7 @@
#lang racket/base
(require (for-syntax racket/base racket/syntax))
(require racket/path)
(require "../setup.rkt" sugar/define sugar/file sugar/string sugar/coerce sugar/test)
(require "../setup.rkt" sugar/define sugar/file sugar/coerce sugar/test)
;; because it comes up all the time
@ -292,6 +292,11 @@
((substring (->string path-string) 0 7) . equal? . "unsaved"))
(define (ends-with? str ender)
(define pat (regexp (format "~a$" ender)))
(and (regexp-match pat str) #t))
(define+provide (magic-directory? path)
(and (directory-exists? path)
(or (ends-with? (path->string path) "compiled"))))

@ -5,7 +5,7 @@
(require web-server/http/request-structs)
(require web-server/http/response-structs)
(require 2htdp/image)
(require "../setup.rkt" "../render.rkt" sugar txexpr "file-utils.rkt" "debug.rkt" "../pagetree.rkt" "../cache.rkt")
(require "../setup.rkt" "../render.rkt" sugar sugar/unstable/string sugar/unstable/misc sugar/unstable/container txexpr "file-utils.rkt" "debug.rkt" "../pagetree.rkt" "../cache.rkt")
(module+ test (require rackunit))
@ -132,10 +132,10 @@
;; dashboard route
(define (dashboard dashboard-ptree)
(define dashboard-dir (get-enclosing-dir dashboard-ptree))
(define dashboard-dir (dirname dashboard-ptree))
(define (in-project-root?)
(directories-equal? dashboard-dir (current-project-root)))
(define parent-dir (and (not (in-project-root?)) (get-enclosing-dir dashboard-dir)))
(define parent-dir (and (not (in-project-root?)) (dirname dashboard-dir)))
(define empty-cell (cons #f #f))
(define (make-link-cell href+text)
(match-define (cons href text) href+text)

@ -1 +1 @@
1454963513
1454975373

@ -1,6 +1,6 @@
#lang racket/base
(require (for-syntax racket/base "../setup.rkt"))
(require racket/list sugar/define sugar/test txexpr racket/match sugar/container sugar/coerce sugar/len racket/string "../private/to-string.rkt" )
(require racket/list sugar/define sugar/test txexpr racket/match sugar/unstable/container sugar/coerce sugar/unstable/len racket/string "../private/to-string.rkt" )
(define (make-replacer query+replacement)
(let ([queries (map car query+replacement)]

Loading…
Cancel
Save