diff --git a/core.rkt b/core.rkt index 26408b4..19fb2c9 100644 --- a/core.rkt +++ b/core.rkt @@ -1,6 +1,6 @@ #lang racket/base (require racket/string racket/list) -(require sugar/string sugar/coercion/values) +(require sugar/string sugar/coerce) (provide (all-defined-out)) diff --git a/info.rkt b/info.rkt index 4a9b0ff..53d8e20 100644 --- a/info.rkt +++ b/info.rkt @@ -1,3 +1,3 @@ #lang info -(define collection "chirp") -(define scribblings '(("scribblings/chirp.scrbl" ()))) \ No newline at end of file +(define collection "css-tools") +(define scribblings '(("scribblings/css-tools.scrbl" ()))) \ No newline at end of file diff --git a/math.rkt b/math.rkt index 65cd244..4e7d003 100644 --- a/math.rkt +++ b/math.rkt @@ -1,7 +1,7 @@ #lang racket/base -(require "core.rkt" racket/match sugar/define/contract sugar/container sugar/coercion/values racket/string racket/list) +(require "core.rkt" racket/match) -(define+provide/contract (css-unit? x) +(define/contract (css-unit? x) (any/c . -> . boolean?) (x . in? . '("%" "in" "cm" "mm" "em" "ex" "pt" "pc" "px" "rem"))) @@ -10,17 +10,17 @@ [(define write-proc (λ(x port mode) (display (format "~a~a" (cssq-num x) (cssq-unit x)) port)))]) -(define+provide/contract (cssqish? x) +(define/contract (cssqish? x) (any/c . -> . boolean?) (->boolean (or (cssq? x) (string? x)))) -(define+provide/contract (string->unit x) +(define/contract (string->unit x) (string? . -> . css-unit?) (if (css-unit? x) x (error 'string->unit "'~a' not a valid css unit" x))) -(define+provide/contract (cssqish->cssq x) +(define/contract (cssqish->cssq x) (cssqish? . -> . cssq?) (cond [(cssq? x) x] @@ -34,7 +34,7 @@ (list (string->number (first pieces)) (string->unit (second pieces))))))])) -(define+provide/contract (css-math-op op left right) +(define/contract (css-math-op op left right) (procedure? cssqish? cssqish? . -> . cssq?) (let ([left (cssqish->cssq left)] [right (cssqish->cssq right)]) diff --git a/scribblings/chirp.scrbl b/scribblings/css-tools.scrbl similarity index 51% rename from scribblings/chirp.scrbl rename to scribblings/css-tools.scrbl index f6477d8..a9f6561 100644 --- a/scribblings/chirp.scrbl +++ b/scribblings/css-tools.scrbl @@ -3,34 +3,34 @@ @(require scribble/eval (for-label racket "../main.rkt")) @(define my-eval (make-base-eval)) -@(my-eval `(require chirp)) +@(my-eval `(require css-tools)) -@title{chirp} +@title{css-tools} @author[(author+email "Matthew Butterick" "mb@mbtype.com")] -Chirp = CSS & HTML Racket preprocessor. +A collection of little functions that help make Racket code more readable. @section{Installation & updates} At the command line: -@verbatim{raco pkg install chirp} +@verbatim{raco pkg install css-tools} After that, you can update the package from the command line: -@verbatim{raco pkg update chirp} +@verbatim{raco pkg update css-tools} @section{Interface} -@defmodule[chirp] +@defmodule[css-tools] -Hello chirp. +Hello css-tools. @section{License & source code} This module is licensed under the LGPL. -Source repository at @link["http://github.com/mbutterick/chirp"]{http://github.com/mbutterick/chirp}. Suggestions & corrections welcome. +Source repository at @link["http://github.com/mbutterick/css-tools"]{http://github.com/mbutterick/css-tools}. Suggestions & corrections welcome.