Typos, tweaks, etc; split text in new-name on double newline.

This commit is contained in:
Eli Barzilay 2010-06-07 21:26:33 -04:00
parent fd1b20c93d
commit 071707f9fa
3 changed files with 16 additions and 5 deletions

View File

@ -85,7 +85,6 @@
"http://download.racket-lang.org/installers/"
"Eli Barzilay"
"eli@barzilay.org")
#;
("USA, Illinois (Northwestern University)"
"http://www.eecs.northwestern.edu/racket/"
"Robby Findler"

View File

@ -139,7 +139,7 @@
(let* ([g "http://www.google.com/search?q="]
[u (string-append g (uri-encode str))]
[rx #rx"(?<=<h3 class=\"r\">).*?(?=</h3>)"])
(regexp-match* rx (get-pure-port (string->url g)))))
(regexp-match* rx (get-pure-port (string->url u)))))
}
@desc{
Add a call to @elemcode{let-me-google-that-for-you} to

View File

@ -4,10 +4,23 @@
(define (url str) (tt (a href: str str)))
;;TODO: this should be done with some common function, together with
;;translating "``" etc.
(define (split-to-paras xs)
(let loop ([cur #f] [paras '()] [xs xs])
(cond
[(null? xs) (map p (reverse (if cur (cons (reverse cur) paras) paras)))]
[cur (if (and (equal? "\n" (car xs))
(pair? (cdr xs)) (equal? "\n" (cadr xs)))
(loop #f (cons (reverse cur) paras) (cdr xs))
(loop (cons (car xs) cur) paras (cdr xs)))]
[else (loop (if (equal? "\n" (car xs)) cur (list (car xs)))
paras (cdr xs))])))
(define ((FAQ tag . ques) . answer)
@div[class: 'faqentry]{
@div[class: 'faqques]{@a[name: tag]{@ques}}
@div[class: 'faqans]{@answer}})
@div[class: 'faqans]{@@(split-to-paras answer)}})
(define styles
@style/inline{
@ -42,7 +55,6 @@
(page #:title "From PLT Scheme to Racket"
styles
@div[class: 'nestedheading]{PLT Scheme is a Racket}
@div[class: 'nested]{Sure, it has parentheses, uses the keyword
@ -135,7 +147,7 @@
possible.}
@@FAQ["edu"]{
How can I tell my department that we should teach with Racket in
How can I tell my department that we should teach with Racket
instead of Scheme? They've never heard of @name{Racket}.
}{