From c9146b38e5ee413f1a909529ce50983500999964 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 6 Jun 2010 17:32:26 -0400 Subject: [PATCH] Add download and version information; download page on main site. --- collects/meta/web/download/data.rkt | 101 ++++++++++++++++++++++ collects/meta/web/download/index.rkt | 2 +- collects/meta/web/download/installers.txt | 0 collects/meta/web/www/download.rkt | 9 ++ collects/meta/web/www/index.rkt | 8 +- 5 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 collects/meta/web/download/data.rkt create mode 100644 collects/meta/web/download/installers.txt create mode 100644 collects/meta/web/www/download.rkt diff --git a/collects/meta/web/download/data.rkt b/collects/meta/web/download/data.rkt new file mode 100644 index 0000000000..9697ac542b --- /dev/null +++ b/collects/meta/web/download/data.rkt @@ -0,0 +1,101 @@ +#lang racket/base + +(define -versions+dates- + '(["5.0" "June 2010"] + ["4.2.5" "April 2010"] + ["4.2.4" "January 2010"] + ["4.2.3" "December 2009"] + ["4.2.2" "October 2009"] + ["4.2.1" "July 2009"] + ["4.2" "June 2009"] + ["4.1.5" "March 2009"] + ["4.1.4" "January 2009"] + ["4.1.3" "November 2008"] + ["4.1.2" "October 2008"] + ["4.1.1" "October 2008"] + ["4.1" "August 2008"] + ["4.0.2" "July 2008"] + ["4.0.1" "June 2008"] + ["4.0" "June 2008"] + ["372" "December 2007"] + ["371" "August 2007"] + ["370" "May 2007"] + ["360" "November 2006"] + ["352" "July 2006"] + ["351" "July 2006"] + ["350" "June 2006"] + ["301" "January 2006"] + ["300" "December 2005"] + ["209" "December 2004"] + ["208" "August 2004"] + ["207" "May 2004"] + ["206p1" "January 2004"] + ["206" "January 2004"] + ["205" "August 2003"] + ["204" "May 2003"] + ["203" "December 2002"] + ["202" "August 2002"] + ["201" "July 2002"] + ["200" "June 2002"] + ["103p1" "August 2001"] + )) + +;; ---------------------------------------------------------------------------- + +(provide versions+dates all-versions current-version) + +(require racket/list racket/file version/utils racket/runtime-path) + +;; ---------------------------------------------------------------------------- + +(define versions+dates + (sort -versions+dates- < + #:key (compose version->integer car) #:cache-keys? #t)) + +(define all-versions (map car versions+dates)) + +(define current-version (last all-versions)) + +;; ---------------------------------------------------------------------------- + +(define-runtime-path installers-data "installers.txt") + +(struct installer + (path ; path to file from the installers directory + version ; version of the installer (as a string) + size ; human-readable size string + package ; package kind symbol 'racket or 'racket-textual + binary? ; #t = binary distribution, #f = source distribution + platform ; platform name string (generic for srcs, cpu-os for bins) + suffix ; string + )) + +(define installer-rx + (pregexp (string-append + "^" + "([0-9.]+[A-Z]+)" ; size + "\t" + "(" ; path + "([0-9p.]+)" ; version + "/" + "(racket(?:-textual)?)" ; package + "/\\4-\\3-" ; -- + "(bin|src)-" ; binary/source + "([^.]+)" ; platform + "\\." + "([a-z]+)" ; suffix + ")$"))) + +(define (make-installer size path version package type platform suffix) + (installer path version size (string->symbol package) (equal? "bin" type) + platform suffix)) + +(define (parse-installers in) + (port-count-lines! in) + (for/list ([line (in-lines in)] [num (in-naturals 1)]) + (apply make-installer + (cdr (or (regexp-match installer-rx line) + (error 'installers "bad installer data line#~a: ~s" + num line)))))) + +(define installers (call-with-input-file installers-data parse-installers)) diff --git a/collects/meta/web/download/index.rkt b/collects/meta/web/download/index.rkt index 4e56624628..9d338023e5 100644 --- a/collects/meta/web/download/index.rkt +++ b/collects/meta/web/download/index.rkt @@ -10,7 +10,7 @@ (provide index) (define index - (page #:link-title "Download" #:window-title "Download Racket" + (page #:link-title "Downloads" @ul{@li{Current @a[href: `(,installers "/recent")]{installers} (or @a[href: installers]{all versions}).} @li{Current documentation in diff --git a/collects/meta/web/download/installers.txt b/collects/meta/web/download/installers.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/collects/meta/web/www/download.rkt b/collects/meta/web/www/download.rkt new file mode 100644 index 0000000000..96c2750da3 --- /dev/null +++ b/collects/meta/web/www/download.rkt @@ -0,0 +1,9 @@ +#lang at-exp s-exp "shared.rkt" + +(provide download) +(define download + (page #:link-title "Download" #:window-title "Download Racket" + #:file "download/" + "Download page comes here.")) + +(require "../download/data.rkt") diff --git a/collects/meta/web/www/index.rkt b/collects/meta/web/www/index.rkt index 1b53935d91..65144fa8a6 100644 --- a/collects/meta/web/www/index.rkt +++ b/collects/meta/web/www/index.rkt @@ -1,6 +1,6 @@ #lang at-exp s-exp "shared.rkt" -(require "code.rkt" "outreach+research.rkt" racket/string) +(require "code.rkt" "download.rkt" "outreach+research.rkt" racket/string) (define (doc s) (string-append "http://docs.racket-lang.org/" s)) @@ -420,13 +420,13 @@ ;; TODO ;; (define screenshots ;; (let ([image (copyfile (in-here "screenshot.jpg"))]) -;; @a[href: "http://plt-scheme.org/screenshots/"]{ +;; @a[href: screenshots]{ ;; @img[src: image alt: "[screenshots]" border: 0 ;; style: "margin-bottom: 2px;"]@; ;; @|br|@small{Screenshots}})) ;; (define tour-video -;; (page #:title "DrScheme Tour" #:file "tour.html" +;; (page #:title "DrRacket Tour" #:file "tour.html" ;; (define (center . body) ;; (table align: 'center style: "margin: 3em 0em;" ;; (tr (td align: 'center body)))) @@ -462,7 +462,7 @@ } setTimeout(init_rollovers, 400); } - @a[href: "http://download.plt-scheme.org/drscheme/" + @a[href: "download/" onmouseover: "set_download_image(1);" onmouseout: "set_download_image(0);"]{ @img[id: "download_button" border: "0" src: img1