From 35f77f61ade51defb46cf01a5cc91c8c5fdd4a94 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 8 Sep 2010 15:11:56 -0400 Subject: [PATCH] Spit out a warning if there are no files rendered. Fix a reference to meta/web to be symbolic -- otherwise things can get confused when symlinks are used, ending up with two instances of a single modeule (once for the symbolic reference and one for a relative one). It's still best to avoid symlinks, though. Simplify version specs in the techreports code, re-enable continue reference, some reformatting. --- collects/meta/web/build.rkt | 7 ++-- collects/meta/web/html/resource.rkt | 8 +++-- collects/meta/web/www/techreports.rkt | 48 ++++++++++++--------------- 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/collects/meta/web/build.rkt b/collects/meta/web/build.rkt index ad54577c21..95ac522d7f 100755 --- a/collects/meta/web/build.rkt +++ b/collects/meta/web/build.rkt @@ -7,10 +7,9 @@ exec "$exe" "$0" "$@" #lang racket/base -(require racket/cmdline racket/runtime-path - racket/string racket/file - "html/resource.rkt" "common/distribute.rkt" - "config.rkt" "navbar.rkt") +(require racket/cmdline racket/runtime-path racket/string racket/file + meta/web/html + "common/distribute.rkt" "config.rkt" "navbar.rkt") (define build-mode #f) (define output-dir (current-directory)) diff --git a/collects/meta/web/html/resource.rkt b/collects/meta/web/html/resource.rkt index 774a299c42..30458d48a7 100644 --- a/collects/meta/web/html/resource.rkt +++ b/collects/meta/web/html/resource.rkt @@ -218,9 +218,11 @@ (provide render-all) (define (render-all) (printf "Rendering...\n") - (let loop () - (let ([todo (get/reset-renderers)]) + (define todo (get/reset-renderers)) + (if (null? todo) + (printf " Warning: no content to render\n") + (let loop ([todo todo]) (unless (null? todo) (for-each (lambda (r) (r)) todo) - (loop)))) ; if more were created + (loop (get/reset-renderers))))) ; if more were created (printf "Rendering done.\n")) diff --git a/collects/meta/web/www/techreports.rkt b/collects/meta/web/www/techreports.rkt index 92c360815f..5d1a26bf96 100644 --- a/collects/meta/web/www/techreports.rkt +++ b/collects/meta/web/www/techreports.rkt @@ -118,8 +118,8 @@ [type "Introduction"]) (more "*...!" plt "More: Systems Programming with PLT Scheme" [type "Introduction"]) - ;; (continue "4.1.1...!" ym "Continue: Web Applications in PLT Scheme" - ;; [type "Introduction"]) + (continue "4.1.1..." ym "Continue: Web Applications in PLT Scheme" + [type "Introduction"]) (guide "*...!" ffplt "Guide: PLT Scheme" [type "Introduction"]) (reference "*...!" fplt "Reference: PLT Scheme") (htdp-langs "*...!" plt "How to Design Programs Languages") @@ -128,7 +128,7 @@ (eopl "*...!" plt "Essentials of Programming Languages Language") (drscheme "*...!" rplt "DrScheme: PLT Programming Environment") (mzc "*...!" plt "mzc: PLT Compilation and Packaging") - (setup-plt "*...!" plt "setup-plt: PLT Configuration and Installation") + (setup-plt "*...!" plt "setup-plt: PLT Configuration and Installation") (planet "*...!" jacobm "PLaneT: Automatic Package Distribution") (redex "4.1...!" robby "Redex: Debugging Operational Semantics") (scribble "*...!" fb "Scribble: PLT Documentation Tool") @@ -191,20 +191,19 @@ (test-box-recovery "*...!" plt "Test Box Recovery Tool") ;; Racket versions - (quick "+..." mflatt + (quick "!..." mflatt "Quick: An Introduction to Racket with Pictures" [type "Introduction"]) - (more "+..." plt "More: Systems Programming with Racket" + (more "!..." plt "More: Systems Programming with Racket" [type "Introduction"]) - (guide "+..." ffplt "Guide: Racket" [type "Introduction"]) - (reference "+..." fplt "Reference: Racket") - (drracket "+..." rplt "DrRacket: Programming Environment") - (scribble "+..." fb "Scribble: Racket Documentation Tool") - (slideshow "+..." ff "Slideshow: Racket Figure and Presentation Tools") - (web-server "+..." jaym "Web Server: Racket HTTP Server") - (foreign "+..." eli "FFI: Racket Foreign Interface") - (inside "+..." mflatt "Inside: Racket C API") - + (guide "!..." ffplt "Guide: Racket" [type "Introduction"]) + (reference "!..." fplt "Reference: Racket") + (drracket "!..." rplt "DrRacket: Programming Environment") + (scribble "!..." fb "Scribble: Racket Documentation Tool") + (slideshow "!..." ff "Slideshow: Racket Figure and Presentation Tools") + (web-server "!..." jaym "Web Server: Racket HTTP Server") + (foreign "!..." eli "FFI: Racket Foreign Interface") + (inside "!..." mflatt "Inside: Racket C API") ;; Both Scheme and Racket (r6rs "*..." plt "R6RS: Standard Language" @@ -244,12 +243,10 @@ ;; "..." all versions ;; "V" specific version ;; "" no versions -;; V can be `*' which is a number between the v3 docs and the v4 docs -;; V can be `!' which is the last PLT Scheme version -;; V can be `+' which is the first Racket version -(define middle-version (ver:version->integer "379")) -(define last-scheme-version (ver:version->integer "4.2.5")) -(define first-racket-version (ver:version->integer "5.0")) +;; V can be `*': a number between the v3 docs and the v4 docs +;; V can be `!': a number between the last PLT Scheme and the first Racket +(define v:3->4 (ver:version->integer "379")) +(define v:4->5 (ver:version->integer "4.3")) (define (versions->pred str) (let* ([str (regexp-replace* #rx" +" str " ")] [str (regexp-replace #rx"^ +" str "")] @@ -257,9 +254,8 @@ [l (regexp-split #rx" *[.][.][.] *" str)] [l (map (lambda (x) (cond [(equal? "" x) #f] - [(equal? "*" x) middle-version] - [(equal? "!" x) last-scheme-version] - [(equal? "+" x) first-racket-version] + [(equal? "*" x) v:3->4] + [(equal? "!" x) v:4->5] [(version->integer x)] [else (error 'versions->pred "bad version: ~e" x)])) l)]) @@ -317,11 +313,12 @@ (let ([n1 "\\url{http://plt-scheme.org/techreports/}"] [n2 (get '#:note #f)]) (if n2 (cons (string-append n1 ";") n2) (list n1)))) - (define old? (< (ver:version->integer ver) first-racket-version)) + (define old? (< (ver:version->integer ver) v:4->5)) (define site (if old? "plt-scheme" "racket-lang")) (define maybe-s (if old? "" "s")) (define (url* path) - (url (format (string-append "http://download." site ".org/doc" maybe-s "/~a/" path) ver docname))) + (url (format (string-append "http://download." site ".org/doc" maybe-s "/~a/" path) + ver docname))) (define pdf-url (url* "pdf/~a.pdf")) (define pdf-html (url* "html/~a/")) (bib 'techreport key @@ -358,4 +355,3 @@ @td{@a[href: (url (make-bib-file bib))]{[bib]}@|nbsp|@; @a[href: (hash-ref bib '#:pdf-url)]{[pdf]}@|nbsp|@; @a[href: (hash-ref bib '#:html-url)]{[html]}}}))) -