From a26daccb557c880dbac384655dd77ca783cb43e7 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 3 Mar 2014 11:39:28 -0800 Subject: [PATCH] changes to test directory --- server-extras/fallback.html.pt | 2 +- server-routes.rkt | 2 +- tests/-stain.html | 3 -- tests/-stain.html.pp | 5 --- tests/bibliography.html | 1 - tests/favicon.ico | 1 - tests/polcom | 3 -- tests/pollen-file-1.html | 3 -- tests/pollen-file-1.p | 70 --------------------------------- tests/pollen-file-2.html | 1 - tests/pollen-file-2.p | 24 ----------- tests/samples/sample-01.html.pm | 3 ++ tests/samples/sample-02.txt.pp | 3 ++ tests/samples/sample-03.txt.p | 1 + tests/server-routes/bar.html | 1 - tests/server-routes/foo.html | 2 - tests/server-routes/foo.pd | 2 - tests/template/put.pd | 7 ---- tests/test-pollen.html | 1 - tests/test-render.rkt | 24 +++++++++++ tests/test.pmap | 5 --- 21 files changed, 33 insertions(+), 131 deletions(-) delete mode 100644 tests/-stain.html delete mode 100644 tests/-stain.html.pp delete mode 100644 tests/bibliography.html delete mode 100644 tests/favicon.ico delete mode 100755 tests/polcom delete mode 100644 tests/pollen-file-1.html delete mode 100644 tests/pollen-file-1.p delete mode 100644 tests/pollen-file-2.html delete mode 100644 tests/pollen-file-2.p create mode 100644 tests/samples/sample-01.html.pm create mode 100644 tests/samples/sample-02.txt.pp create mode 100644 tests/samples/sample-03.txt.p delete mode 100644 tests/server-routes/bar.html delete mode 100644 tests/server-routes/foo.html delete mode 100644 tests/server-routes/foo.pd delete mode 100644 tests/template/put.pd delete mode 100644 tests/test-pollen.html create mode 100644 tests/test-render.rkt delete mode 100644 tests/test.pmap diff --git a/server-extras/fallback.html.pt b/server-extras/fallback.html.pt index eebe495..87e547b 100644 --- a/server-extras/fallback.html.pt +++ b/server-extras/fallback.html.pt @@ -1 +1 @@ -◊(->html (html (head (meta 'charset: "UTF-8")) (body "Rendered without template:" (hr) main))) \ No newline at end of file +◊(->html (html (head (meta 'charset: "UTF-8")) (body "Rendered without template:" (hr) doc))) \ No newline at end of file diff --git a/server-routes.rkt b/server-routes.rkt index 95ec5a2..9fa86ba 100644 --- a/server-routes.rkt +++ b/server-routes.rkt @@ -37,7 +37,7 @@ (define client (request-client-ip req)) (define localhost-client "::1") (define url-string (url->string (request-uri req))) - (message "Request:" (string-replace url-string world:dashboard-name " dashboard") + (message "request:" (string-replace url-string world:dashboard-name " dashboard") (if (not (equal? client localhost-client)) (format "from ~a" client) ""))) ;; pass string args to route, then diff --git a/tests/-stain.html b/tests/-stain.html deleted file mode 100644 index 5ac9228..0000000 --- a/tests/-stain.html +++ /dev/null @@ -1,3 +0,0 @@ -OH JOY - -◊(put-as-html main) \ No newline at end of file diff --git a/tests/-stain.html.pp b/tests/-stain.html.pp deleted file mode 100644 index 9b3df2f..0000000 --- a/tests/-stain.html.pp +++ /dev/null @@ -1,5 +0,0 @@ -#lang planet mb/pollen/pre - -OH JOY - -◊"◊"(put-as-html main) \ No newline at end of file diff --git a/tests/bibliography.html b/tests/bibliography.html deleted file mode 100644 index 5f43fcb..0000000 --- a/tests/bibliography.html +++ /dev/null @@ -1 +0,0 @@ -

Bibliography

This is not, by any measure, a comprehensive bibliography. Rather, it’s a selection of favorites from my own bookshelf that I consult most frequently in my work as a writer and a typographer.

writing

Bryan A. Garner, Garner’s Modern American Usage, 3rd ed. (New York: Oxford University Press, 2009).

Long before he agreed to write the foreword for my book Typography for Lawyers, Bryan Garner was a hero of mine. Garner thinks and writes about American English in a way that’s rigorous, convincing, and accessible. He is stern but not shrill; authoritative but not authoritarian. He is a vigorous advocate for clear, simple writing. His work should be mandatory reading for all writers.

Typography

Matthew Butterick, Typography for Lawyers (Houston: Jones McClure Publishing, 2010).

The precursor to Butterick’s Practical Typography. Lawyer or not, consider buying a copy, because it’s a virtuous act. See how to pay for this book.

Jan Middendorp, Shaping Text (Amsterdam: BIS Publishers, 2012).

If you get a second book on typography, get this one. Middendorp’s beautifully written and illustrated book is full of careful details and lucid explanations.

Carolina de Bartolo, Explorations in Typography (explorationsintypography.comhttp://explorationsintypography.com, 2011).

Using a Spiekermann essay from Stop Stealing Sheep (see below), de Bartolo shows how different typesetting choices change the effect of the text.

Cyrus Highsmith, Inside Paragraphs (Boston: Font Bureau, 2012).

Highsmith’s charmingly hand-illustrated book focuses on the paragraph as a unit of typographic interest.

Robert Bringhurst, The Elements of Typographic Style, 3rd ed. (Vancouver: Hartley and Marks Publishers, 2004).

Bringhurst’s book has become something of a standard reference guide among professional typographers, bringing together the history, theory, and practice of typography.

Ellen Lupton, Thinking With Type, 2nd ed. (New York: Princeton Architectural Press, 2010).

Intended as an introduction to typography for design students, Lupton’s book is more accessible than Bringhurst’s. It includes full-color illustrations from every era of typography.

Fonts

Erik Spiekermann and E. M. Ginger, Stop Stealing Sheep & Find Out How Type Works, 2nd ed. (Berkeley, California: Adobe Press, 2002).

Ginger & Spiekermann, a self-described typomaniac (and author of the foreword) explain how fonts work, and how they differ in appearance and in function. My font Hermes is among those featured.

Stephen Coles, The Anatomy of Type (London: Quid Publishing Ltd., 2012).

Explores the major categories of fonts and their characteristic qualities by examining 100 fonts in detail.

Design principles

Edward Tufte, Envisioning Information, 4th printing ed. (Cheshire, Connecticut: Graphics Press, 1990).

Edward Tufte, The Visual Display of Quantitative Information, 2nd ed. (Cheshire, Connecticut: Graphics Press, 2001).

These are two of my favorite books of all time. Tufte makes an eloquent and compelling case for why design matters. Both books are fantastically interesting and beautifully illustrated with examples of information design from many historical periods.

William Lidwell, Kritina Holden, and Jill Butler, Universal Principles of Design, 2nd ed. (Beverly, Massachusetts: Rockport Publishers, 2010).

An excellent and accessible introduction to design principles that apply not only to printed documents, but to all objects that we interact with.

\ No newline at end of file diff --git a/tests/favicon.ico b/tests/favicon.ico deleted file mode 100644 index 8b13789..0000000 --- a/tests/favicon.ico +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/polcom b/tests/polcom deleted file mode 100755 index e71aeae..0000000 --- a/tests/polcom +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/racket -#lang racket/base -(require (planet mb/pollen/command)) \ No newline at end of file diff --git a/tests/pollen-file-1.html b/tests/pollen-file-1.html deleted file mode 100644 index dad25c8..0000000 --- a/tests/pollen-file-1.html +++ /dev/null @@ -1,3 +0,0 @@ -OH JOY - -put-as-htmlroot-functionptopicclasssmallBibliographyplcThis is not, by any measure, a comprehensive bibliography. Rather, it’s a selection of favorites from my own bookshelf that I consult most frequently in my work as a writer and a typographer.psubheadwritingpBryan A. Garner, bookGarner’s Modern American Usage, 3rd ed. (New York: Oxford University Press, 2009).pindentedstyleposition:relative;top:-0.4emLong before he agreed to write the foreword for my book bookTypography for Lawyers, Bryan Garner was a hero of mine. Garner thinks and writes about American English in a way that’s rigorous, convincing, and accessible. He is stern but not shrill; authoritative but not authoritarian. He is a vigorous advocate for clear, simple writing. His work should be mandatory reading for all writers.psubheadTypographypMatthew Butterick, bookTypography for Lawyers (Houston: Jones McClure Publishing, 2010).pindentedstyleposition:relative;top:-0.4emThe precursor to bookButterick’s Practical Typography. Lawyer or not, consider buying a copy, because it’s a virtuous act. See xrefhow to pay for this book.pJan Middendorp, bookShaping Text (Amsterdam: BIS Publishers, 2012).pindentedstyleposition:relative;top:-0.4emIf you get a second book on typography, get this one. Middendorp’s beautifully written and illustrated book is full of careful details and lucid explanations.pCarolina de Bartolo, bookExplorations in Typography (slinkexplorationsintypography.comhttp://explorationsintypography.com, 2011).pindentedstyleposition:relative;top:-0.4emUsing a Spiekermann essay from bookStop Stealing Sheep (see below), de Bartolo shows how different typesetting choices change the effect of the text.pCyrus Highsmith, bookInside Paragraphs (Boston: Font Bureau, 2012).pindentedstyleposition:relative;top:-0.4emHighsmith’s charmingly hand-illustrated book focuses on the paragraph as a unit of typographic interest.pRobert Bringhurst, bookThe Elements of Typographic Style, 3rd ed. (Vancouver: Hartley and Marks Publishers, 2004).pindentedstyleposition:relative;top:-0.4emBringhurst’s book has become something of a standard reference guide among professional typographers, bringing together the history, theory, and practice of typography.pEllen Lupton, bookThinking With Type, 2nd ed. (New York: Princeton Architectural Press, 2010).pindentedstyleposition:relative;top:-0.4emIntended as an introduction to typography for design students, Lupton’s book is more accessible than Bringhurst’s. It includes full-color illustrations from every era of typography.psubheadFontspErik Spiekermann and E. M. Ginger, bookStop Stealing Sheep & Find Out How Type Works, 2nd ed. (Berkeley, California: Adobe Press, 2002).pindentedstyleposition:relative;top:-0.4emGinger & Spiekermann, a self-described typomaniac (and author of the xrefforeword) explain how fonts work, and how they differ in appearance and in function. My font xrefHermes is among those featured.pStephen Coles, bookThe Anatomy of Type (London: Quid Publishing Ltd., 2012).pindentedstyleposition:relative;top:-0.4emExplores the major categories of fonts and their characteristic qualities by examining 100 fonts in detail.psubheadDesign principlespEdward Tufte, bookEnvisioning Information, 4th printing ed. (Cheshire, Connecticut: Graphics Press, 1990).pEdward Tufte, bookThe Visual Display of Quantitative Information, 2nd ed. (Cheshire, Connecticut: Graphics Press, 2001).pindentedstyleposition:relative;top:-0.4emThese are two of my favorite books of all time. Tufte makes an eloquent and compelling case for why design matters. Both books are fantastically interesting and beautifully illustrated with examples of information design from many historical periods.pWilliam Lidwell, Kritina Holden, and Jill Butler, bookUniversal Principles of Design, 2nd ed. (Beverly, Massachusetts: Rockport Publishers, 2010).pindentedstyleposition:relative;top:-0.4emAn excellent and accessible introduction to design principles that apply not only to printed documents, but to all objects that we interact with. \ No newline at end of file diff --git a/tests/pollen-file-1.p b/tests/pollen-file-1.p deleted file mode 100644 index 35ab436..0000000 --- a/tests/pollen-file-1.p +++ /dev/null @@ -1,70 +0,0 @@ -#lang planet mb/pollen - -◊meta["template" "-stain.html"] - -◊topic['((class "small"))]{Bibliography} - -◊lc{T}his is not, by any measure, a comprehensive bibliography. Rather, it’s a selection of favorites from my own bookshelf that I consult most frequently in my work as a writer and a typographer. - -◊(define (book-description . stuff) -`(indented ((style "position:relative;top:-0.4em")) ,@stuff)) - -◊subhead{writing} - -Bryan A. Garner, ◊book{Garner’s Modern American Usage}, 3rd ed. (New York: Oxford University Press, 2009). - -◊book-description{Long before he agreed to write the foreword for my book ◊book{Typography for Lawyers}, Bryan Garner was a hero of mine. Garner thinks and writes about American English in a way that’s rigorous, convincing, and accessible. He is stern but not shrill; authoritative but not authoritarian. He is a vigorous advocate for clear, simple writing. His work should be mandatory reading for all writers.} - -◊subhead{Typography} - -Matthew Butterick, ◊book{Typography for Lawyers} (Houston: Jones McClure Publishing, 2010). - -◊book-description{The precursor to ◊book{Butterick's Practical Typography}. Lawyer or not, consider buying a copy, because it's a virtuous act. See ◊xref{how to pay for this book.}} - -Jan Middendorp, ◊book{Shaping Text} (Amsterdam: BIS Publishers, 2012). - -◊book-description{If you get a second book on typography, get this one. Middendorp’s beautifully written and illustrated book is full of careful details and lucid explanations.} - - -Carolina de Bartolo, ◊book{Explorations in Typography} (◊slink["explorationsintypography.com" "http://explorationsintypography.com"], 2011). - -◊book-description{Using a Spiekermann essay from ◊book{Stop Stealing Sheep} (see below), de Bartolo shows how different typesetting choices change the effect of the text.} - -Cyrus Highsmith, ◊book{Inside Paragraphs} (Boston: Font Bureau, 2012). - -◊book-description{Highsmith's charmingly hand-illustrated book focuses on the paragraph as a unit of typographic interest.} - - - -Robert Bringhurst, ◊book{The Elements of Typographic Style}, 3rd ed. (Vancouver: Hartley and Marks Publishers, 2004). - -◊book-description{Bringhurst’s book has become something of a standard reference guide among professional typographers, bringing together the history, theory, and practice of typography.} - -Ellen Lupton, ◊book{Thinking With Type}, 2nd ed. (New York: Princeton Architectural Press, 2010). - -◊book-description{Intended as an introduction to typography for design students, Lupton’s book is more accessible than Bringhurst’s. It includes full-color illustrations from every era of typography.} - - -◊subhead{Fonts} - -Erik Spiekermann and E. M. Ginger, ◊book{Stop Stealing Sheep & Find Out How Type Works}, 2nd ed. (Berkeley, California: Adobe Press, 2002). - -◊book-description{Ginger & Spiekermann, a self-described typomaniac (and author of the ◊xref{foreword}) explain how fonts work, and how they differ in appearance and in function. My font ◊xref{Hermes} is among those featured.} - -Stephen Coles, ◊book{The Anatomy of Type} (London: Quid Publishing Ltd., 2012). - -◊book-description{Explores the major categories of fonts and their characteristic qualities by examining 100 fonts in detail.} - - - -◊subhead{Design principles} - -Edward Tufte, ◊book{Envisioning Information}, 4th printing ed. (Cheshire, Connecticut: Graphics Press, 1990). - -Edward Tufte, ◊book{The Visual Display of Quantitative Information}, 2nd ed. (Cheshire, Connecticut: Graphics Press, 2001). - -◊book-description{These are two of my favorite books of all time. Tufte makes an eloquent and compelling case for why design matters. Both books are fantastically interesting and beautifully illustrated with examples of information design from many historical periods.} - -William Lidwell, Kritina Holden, and Jill Butler, ◊book{Universal Principles of Design}, 2nd ed. (Beverly, Massachusetts: Rockport Publishers, 2010). - -◊book-description{An excellent and accessible introduction to design principles that apply not only to printed documents, but to all objects that we interact with.} diff --git a/tests/pollen-file-2.html b/tests/pollen-file-2.html deleted file mode 100644 index d88909a..0000000 --- a/tests/pollen-file-2.html +++ /dev/null @@ -1 +0,0 @@ -FALLBACK! put-as-htmlroot-functionpdquo“Hello” world, aren’t you—yes, you—about 1–2 inches tall?bloqIn a blockpWefooblesquo‘Love’pGoodnightbrmoonpbar \ No newline at end of file diff --git a/tests/pollen-file-2.p b/tests/pollen-file-2.p deleted file mode 100644 index f74617b..0000000 --- a/tests/pollen-file-2.p +++ /dev/null @@ -1,24 +0,0 @@ -#lang planet mb/pollen - -◊meta["metakey" "metavalue"] - - -"Hello" world, aren't you --- yes, you — about 1--2 inches tall? - - -◊;todo: make this recognized as a block. -◊bloq{In a block} - -We - -◊fooble{'Love'} - -Goodnight -moon - - -◊foo - - - - diff --git a/tests/samples/sample-01.html.pm b/tests/samples/sample-01.html.pm new file mode 100644 index 0000000..3c1b127 --- /dev/null +++ b/tests/samples/sample-01.html.pm @@ -0,0 +1,3 @@ +#lang pollen + +This is sample 01. \ No newline at end of file diff --git a/tests/samples/sample-02.txt.pp b/tests/samples/sample-02.txt.pp new file mode 100644 index 0000000..2d66803 --- /dev/null +++ b/tests/samples/sample-02.txt.pp @@ -0,0 +1,3 @@ +#lang pollen + +This is sample-02. \ No newline at end of file diff --git a/tests/samples/sample-03.txt.p b/tests/samples/sample-03.txt.p new file mode 100644 index 0000000..80c513c --- /dev/null +++ b/tests/samples/sample-03.txt.p @@ -0,0 +1 @@ +This is sample-03. \ No newline at end of file diff --git a/tests/server-routes/bar.html b/tests/server-routes/bar.html deleted file mode 100644 index 9a6a8d8..0000000 --- a/tests/server-routes/bar.html +++ /dev/null @@ -1 +0,0 @@ -

bar

\ No newline at end of file diff --git a/tests/server-routes/foo.html b/tests/server-routes/foo.html deleted file mode 100644 index bb742b4..0000000 --- a/tests/server-routes/foo.html +++ /dev/null @@ -1,2 +0,0 @@ -FALLBACK! put-as-htmlroot - foo \ No newline at end of file diff --git a/tests/server-routes/foo.pd b/tests/server-routes/foo.pd deleted file mode 100644 index 8b98967..0000000 --- a/tests/server-routes/foo.pd +++ /dev/null @@ -1,2 +0,0 @@ -#lang planet mb/pollen -foo \ No newline at end of file diff --git a/tests/template/put.pd b/tests/template/put.pd deleted file mode 100644 index 564af9d..0000000 --- a/tests/template/put.pd +++ /dev/null @@ -1,7 +0,0 @@ -#lang pollen - -◊em{One} paragraph - -Another ◊em{paragraph} - -◊meta["foo" "bar"] \ No newline at end of file diff --git a/tests/test-pollen.html b/tests/test-pollen.html deleted file mode 100644 index 5f43fcb..0000000 --- a/tests/test-pollen.html +++ /dev/null @@ -1 +0,0 @@ -

Bibliography

This is not, by any measure, a comprehensive bibliography. Rather, it’s a selection of favorites from my own bookshelf that I consult most frequently in my work as a writer and a typographer.

writing

Bryan A. Garner, Garner’s Modern American Usage, 3rd ed. (New York: Oxford University Press, 2009).

Long before he agreed to write the foreword for my book Typography for Lawyers, Bryan Garner was a hero of mine. Garner thinks and writes about American English in a way that’s rigorous, convincing, and accessible. He is stern but not shrill; authoritative but not authoritarian. He is a vigorous advocate for clear, simple writing. His work should be mandatory reading for all writers.

Typography

Matthew Butterick, Typography for Lawyers (Houston: Jones McClure Publishing, 2010).

The precursor to Butterick’s Practical Typography. Lawyer or not, consider buying a copy, because it’s a virtuous act. See how to pay for this book.

Jan Middendorp, Shaping Text (Amsterdam: BIS Publishers, 2012).

If you get a second book on typography, get this one. Middendorp’s beautifully written and illustrated book is full of careful details and lucid explanations.

Carolina de Bartolo, Explorations in Typography (explorationsintypography.comhttp://explorationsintypography.com, 2011).

Using a Spiekermann essay from Stop Stealing Sheep (see below), de Bartolo shows how different typesetting choices change the effect of the text.

Cyrus Highsmith, Inside Paragraphs (Boston: Font Bureau, 2012).

Highsmith’s charmingly hand-illustrated book focuses on the paragraph as a unit of typographic interest.

Robert Bringhurst, The Elements of Typographic Style, 3rd ed. (Vancouver: Hartley and Marks Publishers, 2004).

Bringhurst’s book has become something of a standard reference guide among professional typographers, bringing together the history, theory, and practice of typography.

Ellen Lupton, Thinking With Type, 2nd ed. (New York: Princeton Architectural Press, 2010).

Intended as an introduction to typography for design students, Lupton’s book is more accessible than Bringhurst’s. It includes full-color illustrations from every era of typography.

Fonts

Erik Spiekermann and E. M. Ginger, Stop Stealing Sheep & Find Out How Type Works, 2nd ed. (Berkeley, California: Adobe Press, 2002).

Ginger & Spiekermann, a self-described typomaniac (and author of the foreword) explain how fonts work, and how they differ in appearance and in function. My font Hermes is among those featured.

Stephen Coles, The Anatomy of Type (London: Quid Publishing Ltd., 2012).

Explores the major categories of fonts and their characteristic qualities by examining 100 fonts in detail.

Design principles

Edward Tufte, Envisioning Information, 4th printing ed. (Cheshire, Connecticut: Graphics Press, 1990).

Edward Tufte, The Visual Display of Quantitative Information, 2nd ed. (Cheshire, Connecticut: Graphics Press, 2001).

These are two of my favorite books of all time. Tufte makes an eloquent and compelling case for why design matters. Both books are fantastically interesting and beautifully illustrated with examples of information design from many historical periods.

William Lidwell, Kritina Holden, and Jill Butler, Universal Principles of Design, 2nd ed. (Beverly, Massachusetts: Rockport Publishers, 2010).

An excellent and accessible introduction to design principles that apply not only to printed documents, but to all objects that we interact with.

\ No newline at end of file diff --git a/tests/test-render.rkt b/tests/test-render.rkt new file mode 100644 index 0000000..aabedd6 --- /dev/null +++ b/tests/test-render.rkt @@ -0,0 +1,24 @@ +#lang racket/base +(require rackunit) +(require "../render.rkt") +(require/expose "../render.rkt" (modification-date-hash)) + +(check-pred hash? modification-date-hash) + +(define sample-dir (string->path "samples")) +(define samples (parameterize ([current-directory sample-dir]) + (map path->complete-path (directory-list ".")))) +(define-values (sample-01 sample-02 sample-03) (apply values samples)) + +(check-equal? (make-mod-dates-key samples) samples) + +(check-false (path->mod-date-value (path->complete-path "garbage-path.zzz"))) +(check-equal? (path->mod-date-value sample-01) (file-or-directory-modify-seconds sample-01)) + +(check-equal? (store-render-in-modification-dates sample-01 sample-02 sample-03) (void)) +(check-true (hash-has-key? modification-date-hash (list sample-01 sample-02 sample-03))) + +(check-true (modification-date-expired? sample-01)) ; because key hasn't been stored +(check-false (apply modification-date-expired? samples)) ; because files weren't changed + + diff --git a/tests/test.pmap b/tests/test.pmap deleted file mode 100644 index d0bab05..0000000 --- a/tests/test.pmap +++ /dev/null @@ -1,5 +0,0 @@ -#lang planet mb/pollen - - -pollen-file-1 -pollen-file-2 \ No newline at end of file