reorganize into packages: "plt-web" and "plt-new-services"

The "plt-new-services" package defines the "meta/new-web"
collection, with the idea that it will be merged into
"plt-services" and later replace "meta/web".
This commit is contained in:
Matthew Flatt 2014-02-09 15:30:30 -07:00
parent 644ae2238b
commit 8ae703cb24
221 changed files with 3808 additions and 12618 deletions

View File

@ -1,50 +1,7 @@
# Numerous always-ignore extensions
*.bak
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
.sass-cache
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
nbproject
*.sublime-project
*.sublime-workspace
# Dreamweaver added files
_notes
dwsync.xml
# Komodo
*.komodoproject
.komodotools
# Espresso
*.esproj
*.espressostorage
# Rubinius
*.rbc
# Folders to ignore
.hg
.svn
.CVS
.idea
output
*/compiled
compiled/
web/out
*~
\#*
.#*
.DS_Store
*.bak
TAGS

View File

@ -1,3 +0,0 @@
all: index.rkt
r index.rkt > index2.html

View File

@ -1,4 +0,0 @@
New Racket Web Page
===================
This is a revision of the existing Racket web page, based on the Gumby framework.

View File

@ -1,7 +0,0 @@
* Mention stackoverflow
* Research page?
* People page
* RacketCon page
* Fix arrows/code for small widths
* More code snippets
* Add "Help" page?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,5 +0,0 @@
{
"name": "gumby",
"version": "2.3.4",
"main": ["./js/libs/gumby.min.js", "./css/gumby.css"]
}

View File

@ -1,80 +0,0 @@
#!/bin/sh
PLTHOME="/home/scheme/plt"
WEBSRC="collects/meta/web" # relative to PLTHOME
SRCDIR="$HOME/src/plt/$WEBSRC" # empty => use code in PLTHOME
DIFFTO="/tmp/w" # empty => no diffing
WEBDIR="/home/scheme/web"
export GIT_DIR="$HOME/src/plt/.git" # for tag info
EXTRA="$HOME/work/iplt/web/all.rkt"
export KNOWN_MIRRORS_FILE="/home/scheme/known-mirror-urls" # to poll mirrors
# Build from here, to here
HERE="$(cd $(dirname "$0"); pwd)"
SRCDIR="$HERE/web"
WEBDIR="$HERE/output"
PLTHOME="$HOME/src/plt"
WEBSRC="pkgs/plt-services/meta/web"
DIFFTO="/tmp/nw"
# PLTHOME="/home/scheme/plt"; SRCDIR=""
# clear
if [ "x$SRCDIR" != "x" ]; then
echo -n "Copying web sources from $SRCDIR"
mv "$PLTHOME/$WEBSRC" "$PLTHOME/$WEBSRC.orig"
cp -a "$SRCDIR" "$PLTHOME/$WEBSRC"
echo ""
fi
cleanup() {
if [ -d "$PLTHOME/$WEBSRC.orig" ] && [ "x$SRCDIR" != "x" ]; then
echo -n "Restoring web sources"
rm -rf "$PLTHOME/$WEBSRC"
mv "$PLTHOME/$WEBSRC.orig" "$PLTHOME/$WEBSRC"
echo ""
fi
}
trap cleanup 0 3 9 15
EXE="$PLTHOME/bin/racket"
if [ ! -x "$EXE" ]; then EXE="$PLTHOME/racket/bin/racket"; fi
if [ ! -x "$EXE" ]; then
echo "racket executable not found" 2>&1; cleanup; exit 1;
fi
"$EXE" -l meta/web/build -- \
--local --extra "$EXTRA" --force --output "$WEBDIR" "$@" \
|| { cleanup; exit 1; }
symlinks2files() {
find "$1" -type l |
while read F; do
L="`readlink \"$F\"`"
rm "$F"
echo "$L" > "$F...symlink"
done
}
files2symlinks() {
find "$1" -type f -name "*...symlink" |
while read F; do
L="`cat \"$F\"`"
rm "$F"
F="${F%%...symlink}"
ln -s "$L" "$F"
done
}
if [ "x$DIFFTO" != "x" ]; then
echo "---- diff ----"
symlinks2files "$DIFFTO"
symlinks2files "$WEBDIR"
diff -rq "$DIFFTO" "$WEBDIR" 2>& 1 \
| grep -v "^Only in .*captcha[0-9].jpg...symlink$" \
| grep -v "httpd/bug-report-captcha and .* differ$" \
| grep -v "bugs/index.html and .* differ$" \
| grep -v "internal/build.html and .* differ"
files2symlinks "$DIFFTO"
files2symlinks "$WEBDIR"
echo "--------------"
fi
cleanup

View File

@ -1,33 +0,0 @@
# Require any additional compass plugins here.
# Tell compass where to find local extensions
# If you followed directions and ran 'gem install modular-scale' comment the next two lines out:
extensions_dir = "sass/extensions"
Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))
# Uncomment these to use regular Ruby gems.
# require 'modular-scale'
# require 'sassy-math'
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
# You can select your preferred output style here (can be overridden via the command line) :nested or :expanded or :compact or :compressed:
output_style = :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

View File

@ -1,22 +0,0 @@
/*
We highly recommend you use SASS and write your custom styles in sass/_custom.scss.
However, this blank file is available if you prefer
*/
body { background: url(img/loud.png) center 60% no-repeat fixed; }
.modal h2, .modal .btn { margin: 10px 0 0px; }
.navbar div ul li a:hover { background: #292929; }
#growboxes { margin-top: 10pt; }
.panetitle { color: red; font-size: 120%; margin-bottom: 4pt }
pre.codesnip { font-size: 140%; }
.wide_only { display: block; }
.narrow_only { display: none; }
@media only screen and (max-width: 767px) {
.wide_only { display: none; }
.narrow_only { display: block; }
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1,47 +0,0 @@
/* TEAM */
Digital Surgeons
Twitter: @digitalsurgeons
Twitter: @gumbycss
Web: www.digitalsurgeons.com
Web: www.gumbyframework.com
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,:~~~====~,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,=================+,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,:==================,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,+=================:,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================:,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~=================~,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~=================~,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,=================~,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==================,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~==============:,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,==========:,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,:~=========:,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,:================,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,:=====================,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,=======================,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,=======================:,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,=======================~,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,=~====================~,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,=~~~~~~~~~~~~~~~~~~~~~=,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,~~==~~~~~~~~~~~~~~=====,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,=~~~~~~~~~~~~~~~~~~~~~,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,=~~~~~~~~~~~~~~~~~~~~~,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,~~~~~~~~~~~~~~~~~~~~,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,~~~~~~~~~~~~~~~~:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,~~~~~~~~~~~~~:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,~~~~~~~~,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,~~~~:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.....

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -1,467 +0,0 @@
<div class="navbar" gumby-fixed="top" id="nav1">
<div class="row">
<a class="toggle" gumby-trigger="#nav1 > .row > ul" href="#"><i class="icon-menu"></i></a>
<a class="five columns logo" href="">
<img class="logo" src="img/logo.png" />
</a>
<ul class="five columns" >
<li><a href="https://pkg.racket-lang.org">Packages</a></li>
<li><a href="http://docs.racket-lang.org">Documentation</a></li>
<li><a href="http://blog.racket-lang.org">Blog</a></li>
<li>
<button class="medium metro info btn icon-left entypo icon-install">
<a href="#">Download</a>
</button>
</li>
</ul>
</div>
</div>
<div class="modal" id="modal1">
<div class="content unique_lines codesnip active">
<a class="close switch" gumby-trigger="|#modal1"><i class="icon-cancel" ></i></a>
<div class="row">
<div class="ten columns centered center-text">
<h4>Unique Lines</h4>
<pre style="font-size: 140%; font-family: 'Inconsolata';">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a>
<span class="codecomment">;; Report each unique line from stdin</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let))" class="codelinkimportform" rel="nofollow">let</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">saw</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._make-hash))" class="codelinkimportid" rel="nofollow">make-hash</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/for.html#(form._((lib._racket/private/base..rkt)._for))" class="codelinkimportform" rel="nofollow">for</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">line</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/sequences.html#(def._((lib._racket/private/base..rkt)._in-lines))" class="codelinkimportid" rel="nofollow">in-lines</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/when_unless.html#(form._((lib._racket/private/letstx-scheme..rkt)._unless))" class="codelinkimportform" rel="nofollow">unless</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-ref))" class="codelinkimportid" rel="nofollow">hash-ref</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#f</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/Writing.html#(def._((lib._racket/private/misc..rkt)._displayln))" class="codelinkimportid" rel="nofollow">displayln</a> <span class="codeid">line</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-set!))"
class="codelinkimportid"
rel="nofollow">hash-set!</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#t</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="row">
<div class="ten columns centered center-text">
<p>
Uses a hash table to record previously seen lines. You can run this program in DrRacket, but it makes more sense from the command line.
</p>
<p>
To run the example, install Racket, start DrRacket, paste the example
program into the top area in DrRacket, and click the Run
button. Alternatively, save the program to a file and run <code>racket</code> on
the file.
</p>
<p style="font-size: 80%">
Form and function names in the code are hyperlinked to
documentation, so click on them for more information.
</p>
</div>
</div>
</div>
<div class="content web_scraper codesnip">
<a class="close switch" gumby-trigger="|#modal1"><i class="icon-cancel" /></i></a>
<div class="row">
<div class="ten columns centered center-text">
<h4>Web scraper</h4>
<pre style="font-size: 140%; font-family: 'Inconsolata';">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a> <span class="codecomment">; Simple web scraper</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/require.html#(form._((lib._racket/private/base..rkt)._require))" class="codelinkimportform" rel="nofollow">require</a> <a href="http://docs.racket-lang.org/net/url.html" class="codemodpath" rel="nofollow">net/url</a> <a href="http://docs.racket-lang.org/net/uri-codec.html" class="codemodpath" rel="nofollow">net/uri-codec</a><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="codelinkimportform" rel="nofollow">define</a> <span class="codeparenthesis">(</span><span class="codeid">let-me-google-that-for-you</span> <span class="codeid">str</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let*))" class="codelinkimportform" rel="nofollow">let*</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">g</span> <span class="codestring">"http://www.google.com/search?q="</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">u</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/strings.html#(def._((quote._~23~25kernel)._string-append))" class="codelinkimportid" rel="nofollow">string-append</a> <span class="codeid">g</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/uri-codec.html#(def._((lib._net/uri-codec..rkt)._uri-encode))" class="codelinkimportid" rel="nofollow">uri-encode</a> <span class="codeid">str</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">rx</span> <span class="codestring">#rx"(?&lt;=&lt;h3 class=\"r\"&gt;).*?(?=&lt;/h3&gt;)"</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/regexp.html#(def._((lib._racket/private/base..rkt)._regexp-match*))" class="codelinkimportid" rel="nofollow">regexp-match*</a> <span class="codeid">rx</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._get-pure-port))" class="codelinkimportid" rel="nofollow">get-pure-port</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._string-~3eurl))" class="codelinkimportid" rel="nofollow">string-&gt;url</a> <span class="codeid">u</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="row">
<div class="ten columns centered center-text">
<p>
Add a call to <code>let-me-google-that-for-you</code> to get a list of search
results.
</p>
<p>
To run the example, install Racket, start DrRacket, paste the example
program into the top area in DrRacket, and click the Run
button. Alternatively, save the program to a file and run <code>racket</code> on
the file.
</p>
<p class="footnote" style="font-size: 80%">
Form and function names in the code are hyperlinked to
documentation, so click on them for more information.
</p>
</div>
</div>
</div>
</div>
<div class="row" >
<div class="ten columns centered">
<h2 style="font-size: 180%; margin-bottom: 10pt">
<strong>Racket</strong> &nbsp;&mdash;&nbsp;
<span style="font-style: italic">a programmable programming
language</span>
</h2>
</div></div>
<div class="row" >
<div class="eight columns centered" style="margin-bottom: 10pt; font-size: 120%; text-align:justify;">
Racket is a wide-spectrum programming language that inherits from Lisp
and Scheme but also provides dialects that support objects, types,
laziness, and many other paradigms. Racket's module system allows
programmers to write and link together components written in different
dialects. Racket's libraries range from web servers to distributed
computing and from databases to charts.
</div>
</div>
<!-- <div class="row" > -->
<!-- <div class="one columns"></div> -->
<!-- <div class="eight columns"><h2 style="font-size: 180%; -->
<!-- margin-bottom: -->
<!-- 10pt"></>Start -->
<!-- Quickly</h2></div> -->
<!-- <div class="three columns"><h2 style="font-size: 180%; -->
<!-- margin-bottom: -->
<!-- 10pt"></>News -->
<!-- </h2></div> -->
<!-- </div> -->
<!-- The other version of the buttons: -->
<!-- <div class="eight columns centered" -->
<!-- style="font-size: 140%; position: relative; -->
<!-- font-family: 'Inconsolata';"> -->
<!-- <a href="#" class="toggle" gumby-trigger=".unique_lines|.web_scraper"> -->
<!-- <img class="halign" src="img/prev.png" style="position: -->
<!-- absolute; top: 50%; left: -20%; margin-top: -25px"> -->
<!-- </a> -->
<!-- <a href="#" class="toggle" gumby-trigger=".unique_lines|.web_scraper"> -->
<!-- <img class="halign" src="img/next.png" -->
<!-- style="position: absolute; top: 50%; right: -20%; -->
<!-- margin-top: -->
<!-- -25px"> -->
<!-- </a> -->
<div id="topcontent">
<div class="row">
<div class="one columns">
</div>
<div class="seven columns" >
<h2 style="font-size: 180%;
margin-bottom:
10pt"></>Start
Quickly</h2>
<div style="position: relative; ">
<p class="metro primary btn"
style="position: absolute; top: -10%; right: 0%;" >
<a href="#" class="switch" gumby-trigger="#modal1"> <i class="icon-help"></i></a>
</p>
<a href="#" class="toggle narrow_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: -40%; left: 35%">
<img src="img/prev.png" style="width: 50px">
</a>
<a href="#" class="toggle narrow_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: -40%; right: 35%">
<img src="img/next.png" style="width: 50px">
</a>
<a href="#" class="toggle wide_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: 40%; left: -15%">
<img src="img/prev.png" style="width: 50px">
</a>
<a href="#" class="toggle wide_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: 40%; right: -15%">
<img src="img/next.png" style="width: 50px">
</a>
<pre class="codesnip active unique_lines" style="font-size: 140%;">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a>
<span class="codecomment">;; Report each unique line from stdin</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let))" class="codelinkimportform" rel="nofollow">let</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">saw</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._make-hash))" class="codelinkimportid" rel="nofollow">make-hash</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/for.html#(form._((lib._racket/private/base..rkt)._for))" class="codelinkimportform" rel="nofollow">for</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">line</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/sequences.html#(def._((lib._racket/private/base..rkt)._in-lines))" class="codelinkimportid" rel="nofollow">in-lines</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/when_unless.html#(form._((lib._racket/private/letstx-scheme..rkt)._unless))" class="codelinkimportform" rel="nofollow">unless</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-ref))" class="codelinkimportid" rel="nofollow">hash-ref</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#f</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/Writing.html#(def._((lib._racket/private/misc..rkt)._displayln))" class="codelinkimportid" rel="nofollow">displayln</a> <span class="codeid">line</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-set!))"
class="codelinkimportid"
rel="nofollow">hash-set!</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#t</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
<pre class="codesnip web_scraper">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a> <span class="codecomment">; Simple web scraper</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/require.html#(form._((lib._racket/private/base..rkt)._require))" class="codelinkimportform" rel="nofollow">require</a> <a href="http://docs.racket-lang.org/net/url.html" class="codemodpath" rel="nofollow">net/url</a> <a href="http://docs.racket-lang.org/net/uri-codec.html" class="codemodpath" rel="nofollow">net/uri-codec</a><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="codelinkimportform" rel="nofollow">define</a> <span class="codeparenthesis">(</span><span class="codeid">let-me-google-that-for-you</span> <span class="codeid">str</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let*))" class="codelinkimportform" rel="nofollow">let*</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">g</span> <span class="codestring">"http://www.google.com/search?q="</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">u</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/strings.html#(def._((quote._~23~25kernel)._string-append))" class="codelinkimportid" rel="nofollow">string-append</a> <span class="codeid">g</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/uri-codec.html#(def._((lib._net/uri-codec..rkt)._uri-encode))" class="codelinkimportid" rel="nofollow">uri-encode</a> <span class="codeid">str</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">rx</span> <span class="codestring">#rx"(?&lt;=&lt;h3 class=\"r\"&gt;).*?(?=&lt;/h3&gt;)"</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/regexp.html#(def._((lib._racket/private/base..rkt)._regexp-match*))" class="codelinkimportid" rel="nofollow">regexp-match*</a> <span class="codeid">rx</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._get-pure-port))" class="codelinkimportid" rel="nofollow">get-pure-port</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._string-~3eurl))" class="codelinkimportid" rel="nofollow">string-&gt;url</a> <span class="codeid">u</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="one columns"> </div>
<div class="three columns" style="text-color: black">
<h2 style="font-size: 180%; margin-bottom: 10pt">News </h2>
<p>Racket version 5.3.5 has been released.</p>
<p>Racket videos are now available.</p>
<p><a href="racketcon.html">RacketCon 2013</a> will be in September in Boston.</p>
</div>
</div>
<div class="row">
<p class="twelve columns centered" style="text-align:justify;font-size: 120%; margin-top: 20pt; ">
<a href="http://docs.racket-lang.org/quick/">Draw more pictures</a> or
<a href="http://docs.racket-lang.org/more/">build a web server from scratch</a>. Racket includes both
<a href="http://docs.racket-lang.org/">batteries</a> and a <a href="http://docs.racket-lang.org/drracket/">programming environment</a>,
so <a href="http://docs.racket-lang.org/getting-started/">get started</a>!
</p>
</div>
</div>
<!-- below code snippets -->
<div class="row">
<div class="ten columns centered">
<h3 >Go Further</h3>
</div>
</div>
<div class="row" id="growboxes">
<div class="four columns">
<div class="panetitle">Grow your Program</div><p>Racket's
<a href="http://docs.racket-lang.org/guide/intro.html#(part._.Interacting_with_.Racket)">interactive mode</a>
encourages experimentation, and quick scripts easily compose into
larger systems. Small scripts and large systems both benefit from
<a href="http://docs.racket-lang.org/guide/performance.html">native-code JIT compilation</a>.
When a system gets too big to keep in your head, you can add
<a href="http://docs.racket-lang.org/ts-guide/index.html">static types</a>.</p>
</div>
<div class="four columns">
<div class="panetitle">Grow your Language</div><p><a href="http://docs.racket-lang.org/guide/languages.html">Extend Racket</a> whenever you need to.
Mold it to better suit your tasks without sacrificing
<a href="http://docs.racket-lang.org/guide/dialects.html">interoperability</a> with existing
libraries and without having to modify the
<a href="http://docs.racket-lang.org/guide/intro.html">tool chain</a>. When less is more, you can
remove parts of a language or start over and build a new one.</p>
</div>
<div class="four columns">
<div class="panetitle">Grow your Skills</div><p>Whether you're just <a href="http://htdp.org/">starting out</a>, want to know more about
programming language <a href="http://www.plai.org/">applications</a> or <a href="http://redex.racket-lang.org/">models</a>,
looking to <a href="http://docs.racket-lang.org/continue/">expand your horizons</a>, or ready to dive into
<a href="learning.html">research</a>, Racket can help you become a better programmer
and system builder.</p>
</div>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3 >Documentation</h3>
</div>
</div>
<div class="row">
<div class="five columns">
<div class="panetitle">For getting started</div>
<p><a href="http://docs.racket-lang.org/quick/"><strong>Quick</strong>:
An Introduction to Racket with
Pictures</a>
gives you a taste of Racket.
</p>
<p><a href="http://docs.racket-lang.org/more/"><strong>More</strong>:
Systems Programming with Racket</a>
dives
much deeper and much faster, showing how to build a complete
continuation-based web server.</p>
<p><a href="http://docs.racket-lang.org/guide/"><strong>Guide</strong>:
Racket</a> starts with a tutorial on Racket basics, and then it
describes the rest of the Racket language.
</p>
</div>
<div class="five columns push_two">
<div class="panetitle">For experienced Racketeers</div>
<p>
<a href="http://docs.racket-lang.org/reference/"><strong>Reference</strong>:
Racket</a> provides comprehensive coverage of all of Racket.
</p>
<p><a href="http://docs.racket-lang.org/continue/"><strong>Continue</strong>:
Web Applications in Racket</a>
describes how to use the
Racket <a href="http://docs.racket-lang.org/web-server/">web
server</a> to build dynamic web applications.
</p>
<p><a href="http://docs.racket-lang.org/pkg/"><strong>Package
Management</strong></a> explains how to install
<a href="https://pkg.racket-lang.org">packages</a>, and how to
build and distribute your own.</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3>Community</h3>
</div>
</div>
<div class=row>
<div class="four columns">
<div class="panetitle">News & Events</div>
<p><a href="racketcon.html">RacketCon</a> — the annual
Racket meeting, coming up in September. Previously
in <a href="http://con.racket-lang.org/2012">2012</a>
and <a href="http://con.racket-lang.org/2012">2011</a>.</p>
<p><a href="http://blog.racket-lang.org/">Blog</a>
— announcements, helpful hints, and thoughtful rants.</p>
<p><a href="http://twitter.com/#!/racketlang">Twitter</a>
— short bits of Racket news.</p>
</div>
<div class="four columns">
<div class="panetitle">Discussion</div>
<p><a href="http://lists.racket-lang.org/">Mailing lists</a>
— discussion for using and developing Racket.</p>
<p><a href="http://racket-lang.org/irc-chat.html">IRC</a>
Chat in the <tt style="background-color: #d8d8e8;"><big><strong>#racket</strong></big></tt> channel on
<a href="http://freenode.net"><tt>freenode.net</tt></a> — an informal
discussion channel for all things related to Racket.
(<a href="https://botbot.me/freenode/racket/">Browse the logs</a>.)</p>
<p><a href="http://racket-lang.org/people.html">People</a>
The people behind Racket.</p>
</div>
<div class="four columns">
<div class="panetitle">Contributing</div>
<p><a href="https://github.com/plt/racket/">Code</a>
— the Racket source code on GitHub.</p>
<p><a href="https://github.com/plt/racket/wiki">Wiki</a>
Useful pages
include <a href="https://github.com/plt/racket/wiki/Intro-Projects">Intro
Projects</a>
and <a href="https://github.com/plt/racket/wiki/Videos">Videos</a>,
including tutorials, interviews, and more.</p>
<p><a href="http://www.cs.utah.edu/plt/snapshots">Snapshot builds</a>
The freshest versions of Racket.</p>
<p><a href="http://bugs.racket-lang.org">Bug reports</a>
File, query and maybe fix existing reports.</p>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3>Learning</h3>
</div>
</div>
<div class="row">
<div class="row">
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://www.htdp.org"><img src="img/htdp-cover.gif" /></a>
</div>
<div class="four columns">
<div class="panetitle">How to Design Programs</div>
<p>A principled approach to program design</p>
<ul>
<li>Teaching language support built-in to DrRacket</li>
<li>Aimed at the programming novice</li>
</ul>
</div>
<div class="four columns">
<div class="panetitle">Realm of Racket</div>
<p>Learn Racket and programming, one game at a time</p>
<ul>
<li>Sample game code comes with the Racket distribution</li>
<li>For those just starting out with Racket</li>
</ul>
</div>
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://www.realmofracket.com"><img src="img/racket_cover_web.png" /></a>
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/">
<img src="img/plai-cover.jpg" />
</a>
</div>
<div class="four columns">
<div class="panetitle">PLAI</div>
<p>Foundations of programming languages</p>
<ul>
<li>Understand the features that make languages tick</li>
<li>For undergraduates, graduate students, and experts</li>
</ul>
</div>
<div class="four columns">
<div class="panetitle">Semantics Engineering with PLT Redex</div>
<p>Lightweight automation for semantics</p>
<ul>
<li>Model your own programming language semantics</li>
<li>For the working language engineer</li>
</ul>
</div>
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://redex.racket-lang.org/">
<img src="img/redex-cover.jpg" />
</a>
</div>
</div>
</div>

View File

@ -1,525 +0,0 @@
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 9]><!--> <html class="no-js" lang="en" itemscope itemtype="http://schema.org/Product"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Use the .htaccess and remove these lines to avoid edge case issues.
More info: h5bp.com/b/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>The Racket Language</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
<!-- CSS: implied media=all -->
<!-- CSS concatenated and minified via ant build script-->
<!-- <link rel="stylesheet" href="css/minified.css"> -->
<!-- CSS imports non-minified for staging, minify before moving to production-->
<link rel="stylesheet" href="css/gumby.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/scribble.css">
<!-- end CSS-->
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
<!-- All JavaScript at the bottom, except for Modernizr / Respond.
Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ -->
<script src="js/libs/modernizr-2.6.2.min.js"></script>
</head>
<body>
<div class="navbar" gumby-fixed="top" id="nav1">
<div class="row">
<a class="toggle" gumby-trigger="#nav1 > .row > ul" href="#"><i class="icon-menu"></i></a>
<a class="five columns logo" href="">
<img class="logo" src="img/logo.png" />
</a>
<ul class="five columns" >
<li><a href="https://pkg.racket-lang.org">Packages</a></li>
<li><a href="http://docs.racket-lang.org">Documentation</a></li>
<li><a href="http://blog.racket-lang.org">Blog</a></li>
<li>
<button class="medium metro info btn icon-left entypo icon-install">
<a href="#">Download</a>
</button>
</li>
</ul>
</div>
</div>
<div class="modal" id="modal1">
<div class="content unique_lines codesnip active">
<a class="close switch" gumby-trigger="|#modal1"><i class="icon-cancel" ></i></a>
<div class="row">
<div class="ten columns centered center-text">
<h4>Unique Lines</h4>
<pre style="font-size: 140%; font-family: 'Inconsolata';">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a>
<span class="codecomment">;; Report each unique line from stdin</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let))" class="codelinkimportform" rel="nofollow">let</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">saw</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._make-hash))" class="codelinkimportid" rel="nofollow">make-hash</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/for.html#(form._((lib._racket/private/base..rkt)._for))" class="codelinkimportform" rel="nofollow">for</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">line</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/sequences.html#(def._((lib._racket/private/base..rkt)._in-lines))" class="codelinkimportid" rel="nofollow">in-lines</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/when_unless.html#(form._((lib._racket/private/letstx-scheme..rkt)._unless))" class="codelinkimportform" rel="nofollow">unless</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-ref))" class="codelinkimportid" rel="nofollow">hash-ref</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#f</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/Writing.html#(def._((lib._racket/private/misc..rkt)._displayln))" class="codelinkimportid" rel="nofollow">displayln</a> <span class="codeid">line</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-set!))"
class="codelinkimportid"
rel="nofollow">hash-set!</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#t</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="row">
<div class="ten columns centered center-text">
<p>
Uses a hash table to record previously seen lines. You can run this program in DrRacket, but it makes more sense from the command line.
</p>
<p>
To run the example, install Racket, start DrRacket, paste the example
program into the top area in DrRacket, and click the Run
button. Alternatively, save the program to a file and run <code>racket</code> on
the file.
</p>
<p style="font-size: 80%">
Form and function names in the code are hyperlinked to
documentation, so click on them for more information.
</p>
</div>
</div>
</div>
<div class="content web_scraper codesnip">
<a class="close switch" gumby-trigger="|#modal1"><i class="icon-cancel" /></i></a>
<div class="row">
<div class="ten columns centered center-text">
<h4>Web scraper</h4>
<pre style="font-size: 140%; font-family: 'Inconsolata';">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a> <span class="codecomment">; Simple web scraper</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/require.html#(form._((lib._racket/private/base..rkt)._require))" class="codelinkimportform" rel="nofollow">require</a> <a href="http://docs.racket-lang.org/net/url.html" class="codemodpath" rel="nofollow">net/url</a> <a href="http://docs.racket-lang.org/net/uri-codec.html" class="codemodpath" rel="nofollow">net/uri-codec</a><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="codelinkimportform" rel="nofollow">define</a> <span class="codeparenthesis">(</span><span class="codeid">let-me-google-that-for-you</span> <span class="codeid">str</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let*))" class="codelinkimportform" rel="nofollow">let*</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">g</span> <span class="codestring">"http://www.google.com/search?q="</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">u</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/strings.html#(def._((quote._~23~25kernel)._string-append))" class="codelinkimportid" rel="nofollow">string-append</a> <span class="codeid">g</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/uri-codec.html#(def._((lib._net/uri-codec..rkt)._uri-encode))" class="codelinkimportid" rel="nofollow">uri-encode</a> <span class="codeid">str</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">rx</span> <span class="codestring">#rx"(?&lt;=&lt;h3 class=\"r\"&gt;).*?(?=&lt;/h3&gt;)"</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/regexp.html#(def._((lib._racket/private/base..rkt)._regexp-match*))" class="codelinkimportid" rel="nofollow">regexp-match*</a> <span class="codeid">rx</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._get-pure-port))" class="codelinkimportid" rel="nofollow">get-pure-port</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._string-~3eurl))" class="codelinkimportid" rel="nofollow">string-&gt;url</a> <span class="codeid">u</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="row">
<div class="ten columns centered center-text">
<p>
Add a call to <code>let-me-google-that-for-you</code> to get a list of search
results.
</p>
<p>
To run the example, install Racket, start DrRacket, paste the example
program into the top area in DrRacket, and click the Run
button. Alternatively, save the program to a file and run <code>racket</code> on
the file.
</p>
<p class="footnote" style="font-size: 80%">
Form and function names in the code are hyperlinked to
documentation, so click on them for more information.
</p>
</div>
</div>
</div>
</div>
<div class="row" >
<div class="ten columns centered">
<h2 style="font-size: 180%; margin-bottom: 10pt">
<strong>Racket</strong> &nbsp;&mdash;&nbsp;
<span style="font-style: italic">a programmable programming
language</span>
</h2>
</div></div>
<div class="row" >
<div class="eight columns centered" style="margin-bottom: 10pt; font-size: 120%; text-align:justify;">
Racket is a wide-spectrum programming language that inherits from Lisp
and Scheme but also provides dialects that support objects, types,
laziness, and many other paradigms. Racket's module system allows
programmers to write and link together components written in different
dialects. Racket's libraries range from web servers to distributed
computing and from databases to charts.
</div>
</div>
<!-- <div class="row" > -->
<!-- <div class="one columns"></div> -->
<!-- <div class="eight columns"><h2 style="font-size: 180%; -->
<!-- margin-bottom: -->
<!-- 10pt"></>Start -->
<!-- Quickly</h2></div> -->
<!-- <div class="three columns"><h2 style="font-size: 180%; -->
<!-- margin-bottom: -->
<!-- 10pt"></>News -->
<!-- </h2></div> -->
<!-- </div> -->
<!-- The other version of the buttons: -->
<!-- <div class="eight columns centered" -->
<!-- style="font-size: 140%; position: relative; -->
<!-- font-family: 'Inconsolata';"> -->
<!-- <a href="#" class="toggle" gumby-trigger=".unique_lines|.web_scraper"> -->
<!-- <img class="halign" src="img/prev.png" style="position: -->
<!-- absolute; top: 50%; left: -20%; margin-top: -25px"> -->
<!-- </a> -->
<!-- <a href="#" class="toggle" gumby-trigger=".unique_lines|.web_scraper"> -->
<!-- <img class="halign" src="img/next.png" -->
<!-- style="position: absolute; top: 50%; right: -20%; -->
<!-- margin-top: -->
<!-- -25px"> -->
<!-- </a> -->
<div id="topcontent">
<div class="row">
<div class="one columns">
</div>
<div class="seven columns" >
<h2 style="font-size: 180%;
margin-bottom:
10pt"></>Start
Quickly</h2>
<div style="position: relative; ">
<p class="metro primary btn"
style="position: absolute; top: -10%; right: 0%;" >
<a href="#" class="switch" gumby-trigger="#modal1"> <i class="icon-help"></i></a>
</p>
<a href="#" class="toggle narrow_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: -40%; left: 35%">
<img src="img/prev.png" style="width: 50px">
</a>
<a href="#" class="toggle narrow_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: -40%; right: 35%">
<img src="img/next.png" style="width: 50px">
</a>
<a href="#" class="toggle wide_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: 40%; left: -15%">
<img src="img/prev.png" style="width: 50px">
</a>
<a href="#" class="toggle wide_only"
gumby-trigger=".unique_lines|.web_scraper" style="position: absolute; top: 40%; right: -15%">
<img src="img/next.png" style="width: 50px">
</a>
<pre class="codesnip active unique_lines" style="font-size: 140%;">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a>
<span class="codecomment">;; Report each unique line from stdin</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let))" class="codelinkimportform" rel="nofollow">let</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">saw</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._make-hash))" class="codelinkimportid" rel="nofollow">make-hash</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/for.html#(form._((lib._racket/private/base..rkt)._for))" class="codelinkimportform" rel="nofollow">for</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">line</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/sequences.html#(def._((lib._racket/private/base..rkt)._in-lines))" class="codelinkimportid" rel="nofollow">in-lines</a><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/when_unless.html#(form._((lib._racket/private/letstx-scheme..rkt)._unless))" class="codelinkimportform" rel="nofollow">unless</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-ref))" class="codelinkimportid" rel="nofollow">hash-ref</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#f</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/Writing.html#(def._((lib._racket/private/misc..rkt)._displayln))" class="codelinkimportid" rel="nofollow">displayln</a> <span class="codeid">line</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-set!))"
class="codelinkimportid"
rel="nofollow">hash-set!</a> <span class="codeid">saw</span> <span class="codeid">line</span> <span class="codeconstant">#t</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
<pre class="codesnip web_scraper">
#lang <a href="http://docs.racket-lang.org/reference/index.html" class="codemodpath" rel="nofollow">racket</a> <span class="codecomment">; Simple web scraper</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/require.html#(form._((lib._racket/private/base..rkt)._require))" class="codelinkimportform" rel="nofollow">require</a> <a href="http://docs.racket-lang.org/net/url.html" class="codemodpath" rel="nofollow">net/url</a> <a href="http://docs.racket-lang.org/net/uri-codec.html" class="codemodpath" rel="nofollow">net/uri-codec</a><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="codelinkimportform" rel="nofollow">define</a> <span class="codeparenthesis">(</span><span class="codeid">let-me-google-that-for-you</span> <span class="codeid">str</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/let.html#(form._((lib._racket/private/letstx-scheme..rkt)._let*))" class="codelinkimportform" rel="nofollow">let*</a> <span class="codeparenthesis">(</span><span class="codeparenthesis">[</span><span class="codeid">g</span> <span class="codestring">"http://www.google.com/search?q="</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">u</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/strings.html#(def._((quote._~23~25kernel)._string-append))" class="codelinkimportid" rel="nofollow">string-append</a> <span class="codeid">g</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/uri-codec.html#(def._((lib._net/uri-codec..rkt)._uri-encode))" class="codelinkimportid" rel="nofollow">uri-encode</a> <span class="codeid">str</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">]</span>
<span class="codeparenthesis">[</span><span class="codeid">rx</span> <span class="codestring">#rx"(?&lt;=&lt;h3 class=\"r\"&gt;).*?(?=&lt;/h3&gt;)"</span><span class="codeparenthesis">]</span><span class="codeparenthesis">)</span>
<span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/reference/regexp.html#(def._((lib._racket/private/base..rkt)._regexp-match*))" class="codelinkimportid" rel="nofollow">regexp-match*</a> <span class="codeid">rx</span> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._get-pure-port))" class="codelinkimportid" rel="nofollow">get-pure-port</a> <span class="codeparenthesis">(</span><a href="http://docs.racket-lang.org/net/url.html#(def._((lib._net/url..rkt)._string-~3eurl))" class="codelinkimportid" rel="nofollow">string-&gt;url</a> <span class="codeid">u</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span><span class="codeparenthesis">)</span>
</pre>
</div>
</div>
<div class="one columns"> </div>
<div class="three columns" style="text-color: black">
<h2 style="font-size: 180%; margin-bottom: 10pt">News </h2>
<p>Racket version 5.3.5 has been released.</p>
<p>Racket videos are now available.</p>
<p><a href="racketcon.html">RacketCon 2013</a> will be in September in Boston.</p>
</div>
</div>
<div class="row">
<p class="twelve columns centered" style="text-align:justify;font-size: 120%; margin-top: 20pt; ">
<a href="http://docs.racket-lang.org/quick/">Draw more pictures</a> or
<a href="http://docs.racket-lang.org/more/">build a web server from scratch</a>. Racket includes both
<a href="http://docs.racket-lang.org/">batteries</a> and a <a href="http://docs.racket-lang.org/drracket/">programming environment</a>,
so <a href="http://docs.racket-lang.org/getting-started/">get started</a>!
</p>
</div>
</div>
<!-- below code snippets -->
<div class="row">
<div class="ten columns centered">
<h3 >Go Further</h3>
</div>
</div>
<div class="row" id="growboxes">
<div class="four columns">
<div class="panetitle">Grow your Program</div><p>Racket's
<a href="http://docs.racket-lang.org/guide/intro.html#(part._.Interacting_with_.Racket)">interactive mode</a>
encourages experimentation, and quick scripts easily compose into
larger systems. Small scripts and large systems both benefit from
<a href="http://docs.racket-lang.org/guide/performance.html">native-code JIT compilation</a>.
When a system gets too big to keep in your head, you can add
<a href="http://docs.racket-lang.org/ts-guide/index.html">static types</a>.</p>
</div>
<div class="four columns">
<div class="panetitle">Grow your Language</div><p><a href="http://docs.racket-lang.org/guide/languages.html">Extend Racket</a> whenever you need to.
Mold it to better suit your tasks without sacrificing
<a href="http://docs.racket-lang.org/guide/dialects.html">interoperability</a> with existing
libraries and without having to modify the
<a href="http://docs.racket-lang.org/guide/intro.html">tool chain</a>. When less is more, you can
remove parts of a language or start over and build a new one.</p>
</div>
<div class="four columns">
<div class="panetitle">Grow your Skills</div><p>Whether you're just <a href="http://htdp.org/">starting out</a>, want to know more about
programming language <a href="http://www.plai.org/">applications</a> or <a href="http://redex.racket-lang.org/">models</a>,
looking to <a href="http://docs.racket-lang.org/continue/">expand your horizons</a>, or ready to dive into
<a href="learning.html">research</a>, Racket can help you become a better programmer
and system builder.</p>
</div>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3 >Documentation</h3>
</div>
</div>
<div class="row">
<div class="five columns">
<div class="panetitle">For getting started</div>
<p><a href="http://docs.racket-lang.org/quick/"><strong>Quick</strong>:
An Introduction to Racket with
Pictures</a>
gives you a taste of Racket.
</p>
<p><a href="http://docs.racket-lang.org/more/"><strong>More</strong>:
Systems Programming with Racket</a>
dives
much deeper and much faster, showing how to build a complete
continuation-based web server.</p>
<p><a href="http://docs.racket-lang.org/guide/"><strong>Guide</strong>:
Racket</a> starts with a tutorial on Racket basics, and then it
describes the rest of the Racket language.
</p>
</div>
<div class="five columns push_two">
<div class="panetitle">For experienced Racketeers</div>
<p>
<a href="http://docs.racket-lang.org/reference/"><strong>Reference</strong>:
Racket</a> provides comprehensive coverage of all of Racket.
</p>
<p><a href="http://docs.racket-lang.org/continue/"><strong>Continue</strong>:
Web Applications in Racket</a>
describes how to use the
Racket <a href="http://docs.racket-lang.org/web-server/">web
server</a> to build dynamic web applications.
</p>
<p><a href="http://docs.racket-lang.org/pkg/"><strong>Package
Management</strong></a> explains how to install
<a href="https://pkg.racket-lang.org">packages</a>, and how to
build and distribute your own.</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3>Community</h3>
</div>
</div>
<div class=row>
<div class="four columns">
<div class="panetitle">News & Events</div>
<p><a href="racketcon.html">RacketCon</a> — the annual
Racket meeting, coming up in September. Previously
in <a href="http://con.racket-lang.org/2012">2012</a>
and <a href="http://con.racket-lang.org/2012">2011</a>.</p>
<p><a href="http://blog.racket-lang.org/">Blog</a>
— announcements, helpful hints, and thoughtful rants.</p>
<p><a href="http://twitter.com/#!/racketlang">Twitter</a>
— short bits of Racket news.</p>
</div>
<div class="four columns">
<div class="panetitle">Discussion</div>
<p><a href="http://lists.racket-lang.org/">Mailing lists</a>
— discussion for using and developing Racket.</p>
<p><a href="http://racket-lang.org/irc-chat.html">IRC</a>
Chat in the <tt style="background-color: #d8d8e8;"><big><strong>#racket</strong></big></tt> channel on
<a href="http://freenode.net"><tt>freenode.net</tt></a> — an informal
discussion channel for all things related to Racket.
(<a href="https://botbot.me/freenode/racket/">Browse the logs</a>.)</p>
<p><a href="http://racket-lang.org/people.html">People</a>
The people behind Racket.</p>
</div>
<div class="four columns">
<div class="panetitle">Contributing</div>
<p><a href="https://github.com/plt/racket/">Code</a>
— the Racket source code on GitHub.</p>
<p><a href="https://github.com/plt/racket/wiki">Wiki</a>
Useful pages
include <a href="https://github.com/plt/racket/wiki/Intro-Projects">Intro
Projects</a>
and <a href="https://github.com/plt/racket/wiki/Videos">Videos</a>,
including tutorials, interviews, and more.</p>
<p><a href="http://www.cs.utah.edu/plt/snapshots">Snapshot builds</a>
The freshest versions of Racket.</p>
<p><a href="http://bugs.racket-lang.org">Bug reports</a>
File, query and maybe fix existing reports.</p>
</div>
</div>
<div class="row">
<div class="ten columns centered">
<h3>Learning</h3>
</div>
</div>
<div class="row">
<div class="row">
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://www.htdp.org"><img src="img/htdp-cover.gif" /></a>
</div>
<div class="four columns">
<div class="panetitle">How to Design Programs</div>
<p>A principled approach to program design</p>
<ul>
<li>Teaching language support built-in to DrRacket</li>
<li>Aimed at the programming novice</li>
</ul>
</div>
<div class="four columns">
<div class="panetitle">Realm of Racket</div>
<p>Learn Racket and programming, one game at a time</p>
<ul>
<li>Sample game code comes with the Racket distribution</li>
<li>For those just starting out with Racket</li>
</ul>
</div>
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://www.realmofracket.com"><img src="img/racket_cover_web.png" /></a>
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/">
<img src="img/plai-cover.jpg" />
</a>
</div>
<div class="four columns">
<div class="panetitle">PLAI</div>
<p>Foundations of programming languages</p>
<ul>
<li>Understand the features that make languages tick</li>
<li>For undergraduates, graduate students, and experts</li>
</ul>
</div>
<div class="four columns">
<div class="panetitle">Semantics Engineering with PLT Redex</div>
<p>Lightweight automation for semantics</p>
<ul>
<li>Model your own programming language semantics</li>
<li>For the working language engineer</li>
</ul>
</div>
<div class="two columns image rounded" style="margin-top: 2pt">
<a href="http://redex.racket-lang.org/">
<img src="img/redex-cover.jpg" />
</a>
</div>
</div>
</div>
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/libs/jquery-1.9.1.min.js"><\/script>')</script>
<script src="js/libs/gumby.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<!-- end scripts-->
</body>
</html>

View File

@ -1,298 +0,0 @@
#lang scribble/html
@(require racket/format)
@(define (css url) @link[href: url rel: "stylesheet" type: "text/css"]{})
@(define (icon name) @i[class: name]{})
@(define (row . content) (apply div class: "row" content))
@(define (js . args) @script[type: "text/javascript" @(apply literal args) "\n"])
@(define (tagline l) @span[style: "font-style: italic" l])
@(define (panetitle l) @div[class: "panetitle" l])
@(define (growbox title . body)
@columns[4 (panetitle (string-append "Grow your " title)) (apply p body)])
@(define (docelem kw name link . text)
(apply p @a[href: link]{@strong[kw]: @|name| } text))
@(define (sectitle name) @columns[10 #:center? #t #:row? #t]{@h3[name]})
@(define (print-num n)
(list-ref
'("one" "two" "three" "four" "five" "six" "seven" "eight" "nine" "ten" "eleven" "twelve" "thirteen")
(sub1 n)))
@(define (columns n #:row? [row? #f] #:center? [center? #f] #:tag [tag div] #:push [push #f] . body)
(define d (apply tag class: (~a (print-num n) " columns"
(if center? " centered" "")
(if push (~a " push_" (print-num push)) "")) body))
(if row? (row d) d))
@(define prev @img[src: "img/prev.png" style: "width: 50px"])
@(define next @img[src: "img/next.png" style: "width: 50px"])
@; The new racket web pages
@doctype['html]
@html{
@head{
@meta[charset: "utf-8"]
@;-- Use the .htaccess and remove these lines to avoid edge case issues.
@; More info: h5bp.com/b/378 --
@meta[http-equiv: "X-UA-Compatible" content: "IE=edge,chrome=1"]
@title{The Racket Language}
@link[rel: "shortcut icon" href: "favicon.ico" type: "image/x-icon"]
@;<!-- Mobile viewport optimized: j.mp/bplateviewport -->
@meta[name: "viewport"
content: "width=device-width, initial-scale=1.0, maximum-scale=1"]
@;<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
@;<!-- CSS: implied media=all -->
@css["css/gumby.css"]
@css["css/style.css"]
@css["css/scribble.css"]
@; <!-- All JavaScript at the bottom, except for Modernizr / Respond.
@; Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
@; For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ -->
@script[src: "js/libs/modernizr-2.6.2.min.js"]
}
@div[class: "navbar" gumby-fixed: "top" id: "nav1"]{
@row{
@a[class: "toggle" gumby-trigger: "#nav1 > .row > ul" href: "#"]{
@icon{icon-menu}}
@a[class: "five columns logo" href: ""]{
@img[class: "logo" src: "img/logo.png"]}
@ul[class: "five columns"]{
@li{@a[href: "https://pkg.racket-lang.org"]{Packages}}
@li{@a[href: "https://docs.racket-lang.org"]{Documentation}}
@li{@a[href: "https://blog.racket-lang.org"]{Blog}}
@li{@button[class: "medium metro info btn icon-left entypo icon-install"]{
@a[href: "#"]{Download}}}}}}
@columns[10 #:row? #t #:center? #t]{
@h2[style: "font-size: 180%; margin-bottom: 10pt"]{
@strong{Racket} @|nbsp mdash nbsp|
@tagline{a programmable programming language}}}
@columns[8 #:center? #t #:row? #t
style: "margin-bottom: 10pt; font-size: 120%; text-align:justify;"]{
Racket is a full-spectrum programming language that inherits from Lisp
and Scheme but also provides dialects that support objects, types,
laziness, and many other paradigms. Racket's module system allows
programmers to write and link together components written in different
dialects. Racket's libraries range from web servers to distributed
computing and from databases to charts.
}
@div[id: "topcontent"]{
@row{
@columns[1]
@columns[7]{
@h2[style: "font-size: 180%; margin-bottom: 10pt"]{Start Quickly}
@div[style: "position: relative"]{
@p[class: "metro primary btn"
style: "position: absolute; top: -10%; right: 0%;"]{
@a[href: "#" class: "switch" gumby-trigger: "#modal1"]{
@icon["icon-help"]}}
@a[href: "#" class: "toggle narrow_only"
gumby-trigger: ".unique_lines|.web_scraper"
style: "position: absolute; top: -40%; left: 35%"]{@prev}
@a[href: "#" class: "toggle narrow_only"
gumby-trigger: ".unique_lines|.web_scraper"
style: "position: absolute; top: -40%; right: 35%"]{@next}
@a[href: "#" class: "toggle wide_only"
gumby-trigger: ".unique_lines|.web_scraper"
style: "position: absolute; top: 40%; left: -15%"]{@prev}
@a[href: "#" class: "toggle wide_only"
gumby-trigger: ".unique_lines|.web_scraper"
style: "position: absolute; top: 40%; right: -15%"]{@next}}}
@columns[1]
@columns[3 style: "text-color: black"]{
@h2[style: "font-size: 180%; margin-bottom: 10pt"]{News}
@p{Racket version 5.3.5 has been released.}
@p{Racket videos are now available.}
@p{@a[href: "racketcon.html"]{RacketCon 2013} will be in September in Boston.}}}
@columns[12 #:row? #t #:center? #t style: "text-align:justify;font-size: 120%; margin-top: 20pt; "]{
@a[href: "http://docs.racket-lang.org/quick/"]{Draw more pictures} or
@a[href: "http://docs.racket-lang.org/more/"]{build a web server from scratch}. Racket includes both
@a[href: "http://docs.racket-lang.org/"]{batteries} and a @a[href: "http://docs.racket-lang.org/drracket/"]{programming environment},
so @a[href: "http://docs.racket-lang.org/getting-started/"]{get started}!
}}
@sectitle{Go Further}
@row[id: 'growboxes]{
@growbox["Program"]{Racket's
@a[href: "http://docs.racket-lang.org/guide/intro.html#(part._.Interacting_with_.Racket)"]{interactive
mode} encourages experimentation, and quick scripts easily compose
into larger systems. Small scripts and large systems both benefit
from
@a[href: "http://docs.racket-lang.org/guide/performance.html"]{native-code
JIT compilation} When a system gets too big to keep in your head, you
can add
@a[href: "http://docs.racket-lang.org/ts-guide/index.html"]{static
types}.}
@growbox["Language"]{@a[href: "http://docs.racket-lang.org/guide/languages.html"]{Extend
Racket} whenever you need to. Mold it to better suit your tasks
without sacrificing
@a[href: "http://docs.racket-lang.org/guide/dialects.html"]{interoperability}
with existing libraries and without having to modify the
@a[href: "http://docs.racket-lang.org/guide/intro.html"]{tool chain}.
When less is more, you can remove parts of a language or start over
and build a new one.}
@growbox["Skills"]{Whether you're just
@a[href: "http://htdp.org/"]{starting out}, want to know more about
programming language @a[href: "http://www.plai.org/"]{applications} or
@a[href: "http://redex.racket-lang.org/"]{models}, looking to
@a[href: "http://docs.racket-lang.org/continue/"]{expand your
horizons}, or ready to dive into @a[href: "learning.html"]{research},
Racket can help you become a better programmer and system builder.}}
@sectitle{Documentation}
@row{
@columns[5]{
@panetitle{For getting started}
@docelem['Quick "An Introduction to Racket with Pictures" "http://docs.racket-lang.org/quick/"]{
gives you a taste of Racket.}
@docelem['More "Systems Programming with Racket" "http://docs.racket-lang.org/more/"]{
dives much deeper and much faster, showing how to build a complete
continuation-based web server.}
@docelem['Guide "Racket" "http://docs.racket-lang.org/guide/"]{
starts with a tutorial on Racket basics, and then it
describes the rest of the Racket language.}}
@columns[5 #:push 2]{
@panetitle{For experienced Racketeers}
@docelem['Reference "Racket" "http://docs.racket-lang.org/reference/"]{
provides comprehensive coverage of all of Racket.}
@docelem['Continue "Web Applications in Racket" "http://docs.racket-lang.org/continue/"]{
describes how to use the
Racket @a[href: "http://docs.racket-lang.org/web-server/"]{web
server} to build dynamic web applications.}
@docelem["Package Management" "Racket" "http://docs.racket-lang.org/pkg/"]{
explains how to install
@a[href: "https://pkg.racket-lang.org"]{packages}, and how to
build and distribute your own.}}
}
@sectitle{Community}
@row{
@columns[4]{
@panetitle{News & Events}
@p{@a[href: "racketcon.html"]{RacketCon} the annual
Racket meeting, coming up in September. Previously
in @a[href: "http://con.racket-lang.org/2012"]{2012}
and @a[href: "http://con.racket-lang.org/2012"]{2011}.}
@p{@a[href: "http://blog.racket-lang.org/"]{Blog}
announcements, helpful hints, and thoughtful rants.}
@p{@a[href: "http://twitter.com/#!/racketlang"]{Twitter}
short bits of Racket news.}
}
@columns[4]{
@panetitle{Discussion}
@p{@a[href: "http://lists.racket-lang.org/"]{Mailing lists}
discussion for using and developing Racket.}
@p{@a[href: "http://racket-lang.org/irc-chat.html"]{IRC}
Chat in the @tt[style: "background-color: #d8d8e8;"]{@big{@strong{#racket}}} channel on
@a[href: "http://freenode.net"]{@tt{freenode.net}} an informal
discussion channel for all things related to Racket.
(@a[href: "https://botbot.me/freenode/racket/"]{Browse the logs}.)}
@p{@a[href: "http://racket-lang.org/people.html"]{People}
The people behind Racket.}
}
@columns[4]{
@panetitle{Contributing}
@p{@a[href: "https://github.com/plt/racket/"]{Code}
the Racket source code on GitHub.}
@p{@a[href: "https://github.com/plt/racket/wiki"]{Wiki}
Useful pages
include @a[href: "https://github.com/plt/racket/wiki/Intro-Projects"]{Intro
Projects}
and @a[href: "https://github.com/plt/racket/wiki/Videos"]{Videos},
including tutorials, interviews, and more.}
@p{@a[href: "http://www.cs.utah.edu/plt/snapshots"]{Snapshot builds}
The freshest versions of Racket.}
@p{@a[href: "http://bugs.racket-lang.org"]{Bug reports}
File, query and maybe fix existing reports.}}}
@sectitle{Learning}
@row{
@row{
@div[class: "two columns image rounded" style: "margin-top: 2pt"]{
@a[href: "http://www.htdp.org"]{@img[src: "img/htdp-cover.gif"]}}
@columns[4]{@panetitle{How to Design Programs}
@p{A principled approach to program design}
@ul{
@li{Teaching language support built-in to DrRacket}
@li{Aimed at the programming novice}}}
@columns[4]{@panetitle{Realm of Racket}
@p{Learn Racket and programming, one game at a time}
@ul{
@li{Sample game code comes with the Racket distribution}
@li{For those just starting out with Racket}
}}
@div[class: "two columns image rounded" style: "margin-top: 2pt"]{
@a[href: "http://www.realmofracket.com"]{@img[src: "img/racket_cover_web.png"]}}
}}
@row{
@row{
@div[class: "two columns image rounded" style: "margin-top: 2pt"]{
@a[href: "http://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/"]{@img[src: "img/plai-cover.jpg"]}}
@columns[4]{@panetitle{PLAI}
@p{Foundations of programming languages}
@ul{
@li{Understand the features that make languages tick}
@li{For undergraduates, graduate students, and experts}}}
@columns[4]{@panetitle{Semantics Engineering with PLT Redex}
@p{Lightweight automation for semantics}
@ul{
@li{Model your own programming language semantics}
@li{For the working language engineer}
}}
@div[class: "two columns image rounded" style: "margin-top: 2pt"]{
@a[href: "http://redex.racket-lang.org/"]{@img[src: "img/redex-cover.jpg"]}}
}}
@;<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
@script[src: "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"]
@js{window.jQuery || document.write('<script src="/js/libs/jquery-1.9.1.min.js"><\/script>')}
@script[src: "js/libs/gumby.min.js"]
@script[src: "js/plugins.js"]
@script[src: "js/main.js"]
}

View File

@ -1,25 +0,0 @@
// Gumby is ready to go
Gumby.ready(function() {
console.log('Gumby is ready to go...', Gumby.debug());
// placeholder polyfil
if(Gumby.isOldie || Gumby.$dom.find('html').hasClass('ie9')) {
$('input, textarea').placeholder();
}
});
// Oldie document loaded
Gumby.oldie(function() {
console.log("This is an oldie browser...");
});
// Touch devices loaded
Gumby.touch(function() {
console.log("This is a touch enabled device...");
});
// Document ready
$(function() {
});

View File

@ -0,0 +1,3 @@
#lang info
(define collection 'multi)

View File

@ -21,15 +21,16 @@ Sources:
To build:
=========
* Run `build.rkt' as the main entry point to building the web pages.
* Run any `index.rkt' to build a page and things that it references.
(Use `-h' as usual.)
* You need to choose `-w' or `-l' for a web or local mode respectively.
The difference is that in local mode inter-site links are set up as
relative links so you can see all sites from the resulting
directories, and this is what you usually need to test things out.
(You will still need to deal with an occasional addition of
"index.html" which is not done when looking at file:// URLs.)
* You can choose `-w' (the default) or `-l' for a web or local mode,
respectively. The difference is that in local mode inter-site links
are set up as relative links so you can see all sites from the
resulting directories, and this is what you usually need to test
things out. (You will still need to deal with an occasional
addition of "index.html" which is not done when looking at file://
URLs.)
* Use `-o <dir>' to specify a directory where the built contents is
placed, otherwise the content will be placed in the current directory.

View File

@ -0,0 +1,3 @@
#lang plt-web
(require "www/all.rkt" "download/all.rkt" "minis/all.rkt" "stubs/all.rkt")

View File

@ -0,0 +1,3 @@
#lang racket/base
(require "index.rkt" "version.rkt" "old-index.rkt")

View File

@ -2,13 +2,15 @@
(define -platform-names-
`(;; source platforms
["src-builtpkgs" "Source + built packages"]
["src" "Source"]
["win" "Windows"]
["mac" "Mac OS X"]
["unix" "Unix"]
;; binary platforms
["i386-win32" "Windows (x86, 32-bit)"]
["x86_64-win32" "Windows (x64, 64-bit)"]
["(ppc|i386|x86_64)-osx-mac"
["(ppc|i386|x86_64)-(?:osx-mac|macosx)"
,(λ (_ cpu)
(format "Mac OS X (~a)"
(cond
@ -29,6 +31,7 @@
["(i386|x86_64)-linux-ubuntu([0-9]+)" "Linux \\1 (Ubuntu \\2)"]
["(i386|x86_64)-linux-ubuntu-([a-z]+)" "Linux \\1 (Ubuntu \\2)"]
["(i386|x86_64)-linux-ubuntu.*" "Linux \\1 (Ubuntu)"]
["(i386|x86_64)-linux" "Linux \\1"]
["(i386|x86_64)-freebsd" "FreeBSD \\1"]
["sparc-solaris" "Sparc Solaris (SunOS)"]
["i386-kernel" "x86 Standalone Kernel"]
@ -40,6 +43,7 @@
["tgz" "Gzipped TAR Archive"]
["zip" "Zipped Archive"]
["dmg" "Disk Image"]
["pkg" "Installer Package"]
["plt" "Racket Package"]
["sit" "StuffIt Archive"]))
@ -95,7 +99,7 @@
;; Used to sort packages when more then one is rendered on a page (delayed)
(define (-installer-orders-)
`((,installer-package ,eq? (racket racket-textual))
`((,installer-package ,eq? (racket racket-minimal racket-textual))
(,installer-binary? ,eq? (#t #f))
(,installer-platform ,regexp-match?
(#px"\\bwin(32)?\\b" #px"\\bmac\\b" #px"\\blinux\\b" #px""))
@ -126,7 +130,7 @@
;; ----------------------------------------------------------------------------
;; Release information
(struct release (version date date-string announcement))
(struct release (version date date-string announcement) #:transparent)
(define announcements #f)
(define (set-announcements-file! file)
@ -162,9 +166,15 @@
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
suffix) ; string
#:transparent)
(define installer-rx
;; Two kinds of installer lines
;; Old-style installer line (before 5.92)
;; eg: "12295243\t5.3.6/racket-textual/racket-textual-5.3.6-bin-i386-linux-f12.sh"
;; eg: "7452375\t5.3.6/racket-textual/racket-textual-5.3.6-src-win.zip"
(define installer-rx1
(pregexp (string-append
"^"
"([0-9.]+)" ; size
@ -181,17 +191,44 @@
"([a-z]+)" ; suffix
"))$")))
(define (make-installer size path version package file type platform suffix)
(define (make-installer1 size path version package file type platform suffix)
(define binary? (equal? "bin" type))
(installer path file (version->release version) (string->number size)
(string->symbol package) (equal? "bin" type) platform suffix))
(string->symbol package) binary? platform suffix))
;; New-style installer line (since 5.92)
;; Differences: no "package" dir, implicit "bin", "src" is platform
;; eg: "87206462\t5.92/racket-5.92-i386-linux-ubuntu-precise.sh"
;; eg: "5708736\t5.92/racket-minimal-5.92-src.tgz"
(define installer-rx2
(pregexp (string-append
"^"
"([0-9.]+)" ; size
"\t"
"(" ; path
"([0-9p.]+)" ; version
"/(" ; file
"(racket(?:-textual|-minimal)?)" ; package
"-\\3-" ; -<version>-
"([^.]+)" ; platform
"\\."
"([a-z]+)" ; suffix
"))$")))
(define (make-installer2 size path version file package platform suffix)
(define binary? (not (regexp-match #rx"^src" platform)))
(installer path file (version->release version) (string->number size)
(string->symbol package) binary? 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))))))
(cond [(regexp-match installer-rx1 line)
=> (lambda (m) (apply make-installer1 (cdr m)))]
[(regexp-match installer-rx2 line)
=> (lambda (m) (apply make-installer2 (cdr m)))]
[else (error 'installers "bad installer data line#~a: ~s"
num line)])))
(define (order->precedes order)
(define =? (car order))

View File

@ -1,6 +1,6 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "data.rkt" "installer-pages.rkt" "symlinks.rkt" "../www/gumby.rkt"
(require "resources.rkt" "data.rkt" "installer-pages.rkt" "symlinks.rkt" plt-web/style
(prefix-in pre: "../stubs/pre.rkt"))
(provide render-download-page)
@ -54,7 +54,8 @@
(define (release-page* rel)
(define ver (release-version rel))
(define title @list{v@ver Release Notes})
@page[#:file (format "v~a.html" ver) #:title title #:part-of 'download]{
@page[#:site download-site
#:file (format "v~a.html" ver) #:title title #:part-of 'download]{
@table[align: 'center]{
@tr{@td{@h2{Release Announcements for Version @ver}}}
@tr{@td{@pre{@release-announcement[rel]}}}}
@ -69,7 +70,7 @@
(define ver (release-version rel))
(define file (format "~a-v~a.html" pkg ver))
(define title @list{Download @(package->name pkg) v@ver})
@page[#:file file #:title title #:width 'full #:part-of 'download]{
@page[#:site download-site #:file file #:title title #:width 'full #:part-of 'download]{
@(render-download-page rel pkg)})
(define style
@style/inline[type: 'text/css]{
@ -85,18 +86,33 @@
.version-row a:hover {
background-color: #eeee22;
}})
@page[#:id 'all-versions #:title "All Versions" #:part-of 'download
(define-values (main-package alt-packages)
(cond [(null? all-packages)
(eprintf "Warning: all-packages is empty\n")
(values 'racket null)]
[else
(values (car all-packages) (cdr all-packages))]))
@page[#:site download-site
#:id 'all-versions #:title "All Versions" #:part-of 'download
#:extra-headers style #:width 'full]{
@columns[10 #:center? #t #:row? #t]{
@table[align: 'center cellspacing: 0 cellpadding: 4 frame: 'box
rules: 'groups]{
@thead{
@tr{@td{@nbsp @strong{Version & Release Notes}}
@(map (λ (p) @th[align: 'center]{@(package->name p)})
all-packages)
@tr{@td{@nbsp @strong{Version & Announcement}}
@th[align: 'center]{@(package->name main-package)}
@th[align: 'center]{Alternative Distributions}
@td{@strong{Documentation}}}}
@(let ([sep (tr style: "height: 4px; margin: 0; padding: 0;"
(td) (map (λ (_) (td)) all-packages))])
;; release=>packages : hash[release => (listof package)]
;; Indicates what packages actually exist (have installers) for a given release.
(define release=>packages (make-hash))
(for ([i (in-list all-installers)])
(define r (installer-release i))
(define prev-packages (hash-ref release=>packages r null))
(unless (member (installer-package i) prev-packages)
(hash-set! release=>packages r (cons (installer-package i) prev-packages))))
(define (cell rel pkg)
@td[align: 'center]{
@nbsp @(make-page rel pkg){[download]} @nbsp})
@ -108,7 +124,17 @@
@tr[class: 'version-row]{
@td{@|nbsp nbsp| @strong{Version @ver},
@(release-page r){@release-date-string[r]} @nbsp}
@(map (λ (p) (cell r p)) all-packages)
@(if (member main-package (hash-ref release=>packages r))
(cell r main-package)
@td[])
@td[align: 'center]{
@nbsp
@(add-between
(for/list ([p (in-list alt-packages)]
#:when (member p (hash-ref release=>packages r)))
((make-page r p) (format "[download ~a]" (package->name p))))
@nbsp)
@nbsp}
@td{@nbsp @a[href: @list{@|docs|/@|ver|/html}]{[HTML]} @;
@nbsp @a[href: @list{@|docs|/@|ver|/pdf}]{[PDF]} @;
@nbsp}}
@ -120,10 +146,11 @@
@nbsp @pre:docs[#:sub 'pdf]{[PDF]} @nbsp}}}}}}))
(define license
@page[#:title "Software License" #:part-of 'download]{
@page[#:site download-site
#:title "Software License" #:part-of 'download]{
@p*{
@~ Racket is distributed under the
@a[href: "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC1"]{
@a[href: "http://www.gnu.org/licenses/lgpl-3.0.html"]{
GNU Lesser General Public License (LGPL)}.
@~ Our primary goal is to help as many people as possible use and
contribute to Racket. We encourage anyone to develop any kind of

View File

@ -0,0 +1,10 @@
#lang plt-web
(require "resources.rkt" "download-pages.rkt")
(provide index)
(define index
@page[#:site download-site
#:link-title "Download" #:window-title "Download Racket"
#:part-of 'download #:width 'full]{
@(render-download-page)})

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "data.rkt" "mirror-link.rkt")
@ -32,7 +32,8 @@
[(render-option) (option value: url platform type)]
[(#f) @a[href: url]{@title}]
[else (error 'installer-page "unknown mode: ~e" mode)]))
@page[#:file html-file #:title title #:referrer this #:part-of 'download]{
@page[#:site download-site
#:file html-file #:title title #:referrer this #:part-of 'download]{
@table[width: "90%" align: 'center]{
@tr[valign: 'top]{
@td[width: "50%"]{

View File

@ -380,3 +380,37 @@
18849342 5.3/racket/racket-5.3-src-mac.dmg
18111154 5.3/racket/racket-5.3-src-unix.tgz
21394184 5.3/racket/racket-5.3-src-win.zip
87193371 5.92/racket-5.92-i386-linux-ubuntu-precise.sh
81829558 5.92/racket-5.92-i386-macosx.dmg
57355560 5.92/racket-5.92-i386-win32.exe
82689151 5.92/racket-5.92-ppc-macosx.dmg
89120041 5.92/racket-5.92-src-builtpkgs.tgz
18822537 5.92/racket-5.92-src.tgz
87349133 5.92/racket-5.92-x86_64-linux-ubuntu-quantal.sh
82559349 5.92/racket-5.92-x86_64-macosx.dmg
58072274 5.92/racket-5.92-x86_64-win32.exe
7102006 5.92/racket-minimal-5.92-i386-linux-ubuntu-precise.sh
7192974 5.92/racket-minimal-5.92-i386-macosx.dmg
5651168 5.92/racket-minimal-5.92-i386-win32.exe
7297318 5.92/racket-minimal-5.92-ppc-macosx.dmg
5709126 5.92/racket-minimal-5.92-src.tgz
7267956 5.92/racket-minimal-5.92-x86_64-linux-ubuntu-quantal.sh
7595402 5.92/racket-minimal-5.92-x86_64-macosx.dmg
6049031 5.92/racket-minimal-5.92-x86_64-win32.exe
87328282 5.93/racket-5.93-i386-linux-ubuntu-precise.sh
81919471 5.93/racket-5.93-i386-macosx.dmg
57413685 5.93/racket-5.93-i386-win32.exe
82725624 5.93/racket-5.93-ppc-macosx.dmg
89272049 5.93/racket-5.93-src-builtpkgs.tgz
18849177 5.93/racket-5.93-src.tgz
87499570 5.93/racket-5.93-x86_64-linux-ubuntu-quantal.sh
82717767 5.93/racket-5.93-x86_64-macosx.dmg
58128353 5.93/racket-5.93-x86_64-win32.exe
7102212 5.93/racket-minimal-5.93-i386-linux-ubuntu-precise.sh
7195272 5.93/racket-minimal-5.93-i386-macosx.dmg
5647643 5.93/racket-minimal-5.93-i386-win32.exe
7297127 5.93/racket-minimal-5.93-ppc-macosx.dmg
5709673 5.93/racket-minimal-5.93-src.tgz
7267738 5.93/racket-minimal-5.93-x86_64-linux-ubuntu-quantal.sh
7594116 5.93/racket-minimal-5.93-x86_64-macosx.dmg
6054011 5.93/racket-minimal-5.93-x86_64-win32.exe

View File

@ -1,15 +1,17 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "symlinks.rkt" "../www/download.rkt")
(require "resources.rkt" "symlinks.rkt")
(provide index)
(define index
@page[#:link-title "Downloads" #:part-of 'download
(provide old-index)
(define old-index
@page[#:site download-site
#:link-title "Downloads" #:part-of 'download
#:file "old-index.html"
#:description
@'{Download Racket, a modern dialect of Lisp/Scheme. @;
Available for Windows, Mac, Linux, and other Unix platforms. @;
Includes the DrRacket IDE.}]{
@div[style: "float: right;"]{@download-button}
@div[style: "float: right;"]{Download}
Use these links to browse the download directories directly:
@ul{@li{Current @a[href: `(,installers "/recent")]{installers}
(or @a[href: installers]{all versions}).}

View File

@ -0,0 +1,5 @@
#lang plt-web
(provide download-site)
(define download-site (site "download"))

View File

@ -0,0 +1,13 @@
#lang plt-web
(require "resources.rkt")
(provide (all-defined-out))
(define (in-ftp . paths)
(string-join (cons "/var/ftp/pub/racket" paths) "/"))
(define docs (symlink #:site download-site "/www/docs"))
(define installers (symlink #:site download-site (in-ftp "installers")))
(define libs (symlink #:site download-site (in-ftp "libs/tags") "libs"))
(define stubs (symlink #:site download-site "/www/stubs"))

View File

@ -1,7 +1,8 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "data.rkt")
(define version.txt
(plain (lazy (let ([v (release-version current-release)])
(plain #:site download-site
(lazy (let ([v (release-version current-release)])
(format "~s" `((recent ,v) (stable ,v)))))))

View File

@ -0,0 +1,15 @@
#lang info
(define collection "www-racket-lang-org")
(define deps '("base"
"plt-web-lib"
"at-exp-lib"
"net-lib"
"racket-index"
"scribble-lib"
"syntax-color-lib"))
(define pkg-desc "Sources for http://racket-lang.org")
(define pkg-authors '(eli mflatt samth))

View File

@ -1,6 +1,6 @@
#lang meta/web
#lang plt-web
(define-context "bugs")
(define bugs-site (site "bugs"))
(define planet-bugs "http://planet.racket-lang.org/trac/newticket")
@ -41,7 +41,7 @@
(require (only-in "../www/download.rkt" download))
(define (cgi-link from . to)
(apply symlink (format "/www/cgi-bin/~a" from) to))
(apply symlink #:site bugs-site (format "/www/cgi-bin/~a" from) to))
(define bug-report-cgi (cgi-link "bug-report" "bug-report.cgi"))
(define bug-report-captcha (cgi-link "bug-report-captcha"))
@ -49,7 +49,7 @@
(define captcha-file+num (make-parameter #f))
(define captcha-text (make-parameter #f))
(define captcha-text-file
@plain[#:file "captcha-text" #:newline #f (or (captcha-text) "")])
@plain[#:site bugs-site #:file "captcha-text" #:newline #f (or (captcha-text) "")])
(define query (cgi-link "gnatsweb" "query"))
@ -168,7 +168,8 @@
(provide (rename-out [index bug-reports]))
(define index
@page[#:title "Bug Reports" #:extra-headers bugs-script
@page[#:site bugs-site
#:title "Bug Reports" #:extra-headers bugs-script
#:extra-body-attrs `(onLoad: "initBugData();")]{
@p[style: '("padding: 5px; color: #aa0000; background-color: #ffffee;"
" border: 1px solid; font-weight: bold;")]{
@ -253,7 +254,7 @@
@input[type: 'submit value: "Submit"]}})
(define thanks
@page[#:title "Thanks!" #:extra-headers bugs-script #:referrer values]{
@page[#:site bugs-site #:title "Thanks!" #:extra-headers bugs-script #:referrer values]{
@p{@strong{Thanks!}}
@p{Your Racket bug report has been submitted.}
@p{You should receive an email confirming your report in a few minutes.

View File

@ -1,13 +1,14 @@
#lang meta/web
#lang plt-web
(define-context "drracket")
(define drracket-site (site "drracket"))
;; This just shows an ascii logo and redirects to the main page. Thanks
;; to Can Burak Cilingir for both the logo and the drracket.org domain
;; name.
(define index
(page #:title "DrRacket" #:extra-headers (lazy headers) (center-div logo)))
(page #:site drracket-site
#:title "DrRacket" #:extra-headers (lazy headers) (center-div logo)))
(require (only-in "../www/all.rkt" main))

View File

@ -1,8 +1,8 @@
#lang meta/web
#lang plt-web
(provide mailing-lists-quick)
(define-context "lists")
(define lists-site (site "lists"))
(struct ML (name gmane-name google-name description))
@ -20,7 +20,8 @@
and help make them.)}})))
(define lists
@page[#:title "Mailing Lists" #:file "" #:part-of 'community
@page[#:site lists-site
#:title "Mailing Lists" #:file "" #:part-of 'community
#:description
@'{Racket mailing lists for users, developers, announcements, and more.}
(define (list-cells what) (map (λ (r) (r what)) list-renderers))

View File

@ -6,4 +6,5 @@
"planet.rkt" "blog.rkt" ; these need to be copied to the service
"pre.rkt" "git.rkt" ; / these are used on the
"mailman.rkt" "dirlist.rkt" ; \ server directly
"wiki.rkt")
"wiki.rkt"
"pkgs.rkt")

View File

@ -1,9 +1,9 @@
#lang meta/web
#lang plt-web
(require (prefix-in www: (only-in "../www/resources.rkt" the-resources))
(require (only-in "../www/resources.rkt" www-site)
racket/port)
(define-context "stubs/blog" #:resources www:the-resources)
(define blog-site (site "stubs/blog" #:resources (site-resources www-site)))
(define racket-css
@text{
@ -26,7 +26,7 @@
})
(define (get-resource-text what #:args [args #f])
(define r (www:the-resources what))
(define r ((site-resources www-site) what))
(define xml (if args (apply r args) r))
(define str (xml->string xml))
;; due to some obscure xml issue the `nbsp' entity is not recognized
@ -38,7 +38,7 @@
(provide blog)
(define blog
@plain[#:file "" #:referrer (λ (u) @a[href: u]{Blog})]{
@plain[#:site blog-site #:file "" #:referrer (λ (u) @a[href: u]{Blog})]{
@; This is the blogger style template file, with one hole for the CSS and one
@; for the navbar, and a few more tweaks (first by soegaard and then by eli).
@;

View File

@ -0,0 +1,22 @@
#lang plt-web
;; This stub is to generate fancy directory listings with the Racket style
(require (only-in "../download/resources.rkt" download-site))
(define dirlist-site (site "stubs/dirlist" #:resources (site-resources download-site)))
(define header+footer
(lazy (regexp-split #rx"{{{BODY}}}"
(xml->string @page[#:site dirlist-site
#:id 'browse-downloads
#:html-only #t
#:part-of 'download
"{{{BODY}}}"]))))
(define header
@plain[#:site dirlist-site
#:file "header.html" #:newline #f (car (force header+footer))])
(define footer
@plain[#:site dirlist-site
#:file "footer.html" #:newline #f (cadr (force header+footer))])

View File

@ -0,0 +1,12 @@
#lang plt-web
(require (only-in "../www/resources.rkt" www-site))
(define docs-site (site "stubs/docs" #:resources (site-resources www-site)))
(provide documentation)
(define documentation
;; This is a stub page to get the header for tweaked doc pages
(page #:site docs-site
#:file "" #:link-title "Documentation" #:window-title "{{{TITLE}}}"
"\n{{{BODY}}}\n"))

View File

@ -1,12 +1,16 @@
#lang meta/web
#lang plt-web
(define-context "stubs/git"
#:robots (add-newlines (for/list ([d '(plt libs testing play)])
@list{Disallow: /@|d|/})))
(require racket/runtime-path)
(define git-site
(site "stubs/git"
#:robots (add-newlines (for/list ([d '(plt libs testing play)])
@list{Disallow: /@|d|/}))))
(define (the-resources) (site-resources git-site))
(provide git)
(define git
@page[#:title "Development Repository" #:file ""]{
@page[#:site git-site #:title "Development Repository" #:file ""]{
This is a stub page to get the header for the gitweb server.})
;; ----------------------------------------------------------------------------
@ -16,21 +20,22 @@
(lazy (cdr (or (regexp-match
;; extract just the meat between the <body>...</body>
#rx"<body[^<>]*>(.*?){{{BODY}}}(.*?)</body>"
(xml->string @page[#:id 'git #:html-only #t "{{{BODY}}}"]))
(xml->string @page[#:site git-site #:id 'git #:html-only #t "{{{BODY}}}"]))
(error 'gitweb-skeleton "internal error")))))
(define header @plain[#:file "header.html" (car (force header+footer))])
(define footer @plain[#:file "footer.html" (cadr (force header+footer))])
(define header @plain[#:site git-site #:file "header.html" (car (force header+footer))])
(define footer @plain[#:site git-site #:file "footer.html" (cadr (force header+footer))])
(define gitweb-logo (copyfile (in-here "gitweb-logo.png") "tiny-logo.png"))
(define-runtime-path gitweb-logo-path "gitweb-logo.png")
(define gitweb-logo (copyfile #:site git-site gitweb-logo-path "tiny-logo.png"))
(define home-text
(lazy @text{
@p{This is the Racket git server.}
@p{See the "brief", PLT-oriented @intro{introduction to git}.}}))
(define home-file @plain[#:file "home-text.html" home-text])
(define home-file @plain[#:site git-site #:file "home-text.html" home-text])
(define gitweb-config
@plain[#:file "gitweb_config.perl"]{
@plain[#:site git-site #:file "gitweb_config.perl"]{
our $projectroot = "repos";
@||
# used in the page's title tag
@ -39,9 +44,9 @@
our $site_header = "header.html";
our $site_footer = "footer.html";
our $home_text = "@(regexp-replace #rx"^.*/" (home-file) "")";
push @"@"stylesheets, "@(the-resources 'style-path)";
push @"@"stylesheets, "@((the-resources) 'style-path)";
@||
our $favicon = "@(the-resources 'icon-path)";
our $favicon = "@((the-resources) 'icon-path)";
our $logo = "@gitweb-logo";
our $logo_url = "http://racket-lang.org/";
our $logo_label = "Racket Homepage";
@ -129,7 +134,7 @@
;; using divs:
(define p* (make-separated-tag values (λ text (apply div class: 'p text))))
@page[#:title "git intro" #:extra-headers style]{
@page[#:site git-site #:title "git intro" #:extra-headers style]{
@sections[#:newpages? #t]

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1,6 +1,6 @@
#lang meta/web
#lang plt-web
(define-context "stubs/mailman")
(define mailman-site (site "stubs/mailman"))
(define (MM . tag) @literal{<MM-@|tag|>})
(define (MM/ . tag) @literal{</MM-@|tag|>})
@ -45,16 +45,18 @@
(length t) (length files)))
(map encoder t))))
(for/list ([f (in-list files)] [i (in-naturals)])
(plain #:file f #:newline #f (list-ref (force p) i))))
(plain #:site mailman-site #:file f #:newline #f (list-ref (force p) i))))
(define generic-templates
(split-template @page[#:html-only #t #:title HOLE
(split-template @page[#:site mailman-site
#:html-only #t #:title HOLE
#:extra-headers style-header #:part-of 'community
HOLE]
"header1.html" "header2.html" "footer.html"))
(define (make-listinfo archive?)
@page[#:title @list{Mailing lists: @MM{List-Name}} #:part-of 'community
@page[#:site mailman-site
#:title @list{Mailing lists: @MM{List-Name}} #:part-of 'community
#:extra-headers style-header
#:file (if archive? "listinfo+archive.html" "listinfo.html")]{
@; --------------------
@ -144,7 +146,8 @@
(define listinfos (map make-listinfo '(#t #f)))
(define subscribe
@page[#:title @list{@MM{List-Name} Subscription results} #:part-of 'community
@page[#:site mailman-site
#:title @list{@MM{List-Name} Subscription results} #:part-of 'community
#:extra-headers style-header]{
@; --------------------
@comment{@||
@ -157,7 +160,8 @@
@MM{Mailman-Footer}})
(define options
@page[#:title @list{@MM{Presentable-User} membership configuration
@page[#:site mailman-site
#:title @list{@MM{Presentable-User} membership configuration
for @MM{List-Name}}
#:part-of 'community
#:extra-headers style-header]{
@ -355,7 +359,8 @@
@MM{Mailman-Footer}})
(define roster
@page[#:title @list{@MM{List-Name} subscribers}
@page[#:site mailman-site
#:title @list{@MM{List-Name} subscribers}
#:part-of 'community
#:extra-headers style-header]{
@; --------------------
@ -395,11 +400,12 @@
(define-syntax (page%% stx)
(syntax-case stx ()
[(page%% #:html-only #t x ...)
#`(lazy (encode-%s (page #:html-only #t x ...)))]
#`(lazy (encode-%s (page #:site mailman-site #:html-only #t x ...)))]
[(page%% x ...)
(let ([id (or (syntax-property stx 'inferred-name)
(syntax-local-name))])
#`(plain #,@(if id #`(#:id '#,id) #`()) #:suffix "html" #:newline #f
#`(plain #:site mailman-site
#,@(if id #`(#:id '#,id) #`()) #:suffix "html" #:newline #f
(page%% #:html-only #t x ...)))]))
(define private
@ -623,7 +629,7 @@
;; symlinks to a directory with the original versions for all files that are
;; not generated above.
(define symlinks
(map (λ(f) (symlink (format "/etc/mailman/templates/en-orig/~a" f)))
(map (λ(f) (symlink #:site mailman-site (format "/etc/mailman/templates/en-orig/~a" f)))
'("admindbdetails.html" "admindbpreamble.html" "admindbsummary.html"
"adminsubscribeack.txt" "adminunsubscribeack.txt" "approve.txt"
"bounce.txt" "checkdbs.txt" "convert.txt" "cronpass.txt" "disabled.txt"

View File

@ -0,0 +1,12 @@
#lang plt-web
(require (only-in "../www/resources.rkt" www-site))
(define pkgs-site (site "stubs/pkgs" #:resources (site-resources www-site)))
(provide pkgs)
(define pkgs
;; This is a stub page to get the header for tweaked doc pages
(page #:site pkgs-site
#:file "" #:link-title "Racket Packages"
"Placeholder...\n"))

View File

@ -1,16 +1,17 @@
#lang meta/web
#lang plt-web
(define-context "stubs/planet")
(define planet-site (site "stubs/planet"))
(provide planet)
(define planet
@page[#:file "" #:link-title "PLaneT" #:window-title "{{{TITLE}}}"
@page[#:site planet-site
#:file "" #:link-title "PLaneT" #:window-title "{{{TITLE}}}"
#:extra-headers "{{{HEAD}}}"]{
@; This is a stub page to get the header for planet
{{{BODY}}}})
(define readme
@plain[#:file "README"]{
@plain[#:site planet-site #:file "README"]{
This directory contains files that are placed here automatically by
the web build process. The HTML file contains holes to be filled in
for the title, header, and body, and the other files are resources

View File

@ -1,8 +1,8 @@
#lang meta/web
#lang plt-web
(require "git.rkt")
(define-context "stubs/pre")
(define pre-site (site "stubs/pre"))
(define temporary-outdated-warning
@div[style: "border: 1px dotted red; padding: 0ex 1ex"]{
@ -30,7 +30,8 @@
(define template
;; generic skeleton for all files that don't have a specific template below.
@page[#:window-title title-hole]{
@page[#:site pre-site
#:window-title title-hole]{
@temporary-outdated-warning
@content-hole
@hr
@ -38,7 +39,8 @@
(provide index)
(define index
@page[#:file "" #:window-title "Prebuilt materials"]{
@page[#:site pre-site
#:file "" #:window-title "Prebuilt materials"]{
@temporary-outdated-warning
@p{This directory contains Racket materials that are built daily from the
development repository. See below for instructions.}
@ -78,7 +80,8 @@
@version-hole})
(define pre-installers
@page[#:file "pre-installers/" #:title "Nightly build pre-installers"]{
@page[#:site pre-site
#:file "pre-installers/" #:title "Nightly build pre-installers"]{
@temporary-outdated-warning
@p{This directory contains distribution packages in tgz format. They are
later converted to the actual platform-specific
@ -90,7 +93,8 @@
(provide installers)
(define installers
@page[#:file "installers/" #:title "Nightly build installers"]{
@page[#:site pre-site
#:file "installers/" #:title "Nightly build installers"]{
@temporary-outdated-warning
@p{Pre-release software is built using actively developed sources.
Binaries are built nightly, and minute-by-minute changes are available
@ -134,7 +138,8 @@
(apply a href: (list (url-of docs) sub "/") (if (null? text) sub text))
(apply docs text)))
(define docs
@page[#:file "docs/" #:title "Prebuilt documentation"]{
@page[#:site pre-site
#:file "docs/" #:title "Prebuilt documentation"]{
@temporary-outdated-warning
@p{This directory contains documentation files in all forms, compiled from
the current sources.}
@ -144,7 +149,8 @@
@version-hole})
(define binaries
@page[#:file "binaries/" #:title "Prebuilt binaries"]{
@page[#:site pre-site
#:file "binaries/" #:title "Prebuilt binaries"]{
@temporary-outdated-warning
@p{This directory contains a subdirectory for each supported platform.}
@hr
@ -153,7 +159,8 @@
@version-hole})
(define script
@page[#:file "script.html" #:title "Using the nightly Racket builds"]{
@page[#:site pre-site
#:file "script.html" #:title "Using the nightly Racket builds"]{
@temporary-outdated-warning
@(define (url . s) @list{http://pre.racket-lang.org/@s})
@(define (pre* . text) (apply pre style: "margin-left: 2em;" text))

View File

@ -0,0 +1,12 @@
#lang plt-web
(require (only-in "../www/resources.rkt" www-site))
(define wiki-site (site "stubs/wiki" #:resources (site-resources www-site)))
(define template
(page #:site wiki-site
#:title "{{{TITLE}}}"
#:extra-headers "{{{HEADERS}}}"
#:extra-body-attrs '(|{{{ATTRS}}}|: #t)
"{{{BODY}}}"))

View File

@ -1,4 +1,4 @@
#lang racket/base
#lang plt-web
(require "index.rkt" "download.rkt" "community.rkt" "learning.rkt" "help.rkt"
"new-name.rkt" "web-copyright.rkt")

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
(require syntax-color/module-lexer setup/xref
scribble/xref scribble/tag)

View File

@ -1,13 +1,15 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "people.rkt" "irc.rkt" "gumby.rkt"
(require plt-web/style
"resources.rkt" "people.rkt" "irc.rkt"
"../minis/lists.rkt" "../minis/bugs.rkt"
"../stubs/blog.rkt" "../stubs/git.rkt"
(prefix-in pre: "../stubs/pre.rkt"))
(provide community)
(define community
@page[#:window-title "Racket Community Resources" #:part-of 'community
@page[#:site www-site
#:window-title "Racket Community Resources" #:part-of 'community
#:description
@'{Racket-related community resources: mailing lists, IRC channel, @;
resources for developers, RacketCon, blog, and more.}]{

View File

@ -1,15 +1,15 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "../download/download-pages.rkt")
(require "resources.rkt"
(prefix-in download: "../download/index.rkt")
racket/runtime-path)
(provide download)
(define download
@page[#:link-title "Download" #:window-title "Download Racket"
#:file "download/" #:part-of 'download #:width 'full]{
@(render-download-page)})
(define download download:index)
(define images (list (copyfile (in-here "img/download.png"))
(copyfile (in-here "img/download-dark.png"))))
(define-runtime-path img-dir "img")
(define images (list (copyfile #:site www-site (build-path img-dir "download.png"))
(copyfile #:site www-site (build-path img-dir "download-dark.png"))))
(provide download-button)
(define (download-button)

View File

@ -1,10 +1,10 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "community.rkt")
(provide help)
(define help
@page[#:link-title "Need Help?"]{
@page[#:site www-site #:link-title "Need Help?"]{
@parlist[@strong{Don't Panic!}
@text{Racket has a variety of resources designed to help you
with any problems you may have.}]

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 231 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -1,5 +1,6 @@
#lang meta/web
#lang plt-web
(require plt-web/style
racket/runtime-path)
;; TODO
;; -- add links in top paragraph
@ -7,7 +8,11 @@
;; -- use links
;; -- indentation
(require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt" "gumby.rkt" "people.rkt")
(require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt" "people.rkt")
(define-runtime-path img-dir "img")
(define-runtime-path js-dir "js")
(define-runtime-path css-dir "css")
(define (doc path . text)
(apply a href: (list "http://docs.racket-lang.org/" path) text))
@ -260,14 +265,6 @@
(define blurb "Racket is a programming language")
(provide set-news-flashes!)
(define news-flashes #f)
(define (set-news-flashes! . text)
(when news-flashes (error 'set-news-flashes! "text already set"))
(set! news-flashes text))
(define (sectitle name) @columns[10 #:center? #t #:row? #t]{@h3[name]})
(define (book-image . l)
@ -280,13 +277,14 @@
(define prev @img[src: (copyfile (in-here "img/prev.png")) style: "width: 50px"])
(define next @img[src: (copyfile (in-here "img/next.png")) style: "width: 50px"])
(define prev @img[src: (copyfile #:site www-site (build-path img-dir "prev.png")) style: "width: 50px"])
(define next @img[src: (copyfile #:site www-site (build-path img-dir "next.png")) style: "width: 50px"])
(provide index)
(define index
@page[#:window-title "The Racket Language"
@page[#:site www-site
#:window-title "The Racket Language"
#:width 'full
#:description
@'{Racket is a modern programming language in the Lisp/Scheme family, @;
@ -295,22 +293,21 @@
integrated development environment, and many batteries-included @;
libraries.}
@; Ask google to not use the ODP description
#:extra-headers @list{@css[(copyfile (in-here "css/frontpage-style.css"))]
@css[(copyfile (in-here "css/scribble.css"))]
@script[src: (copyfile (in-here "js/slideshow.js"))]
#:extra-headers @list{@css[(copyfile #:site www-site (build-path css-dir "frontpage-style.css"))]
@css[(copyfile #:site www-site (build-path css-dir "scribble.css"))]
@script[src: (copyfile #:site www-site (build-path js-dir "slideshow.js"))]
@meta[name: "robots" content: "NOODP"]}]{
@columns[10 #:row? #t #:center? #t]{
@h2[style: "font-size: 180%; margin-bottom: 10pt"]{
@strong{Racket} @|nbsp|@|mdash|@|nbsp|
@span[style: "font-style: italic;"]{a programmable programming language}}}
A programmable programming language}}
@columns[8 #:center? #t #:row? #t
style: "margin-bottom: 10pt; font-size: 120%; text-align:justify;"]{
Racket is a full-spectrum programming language that inherits from Lisp
@strong{Racket} is a full-spectrum programming language that inherits from Lisp
and Scheme but also provides dialects that support objects, types,
laziness, and many other paradigms. Racket's module system allows
programmers to write and link together components written in different
dialects. Racket's libraries range from web servers to distributed
dialects. Racket's libraries support applications from web servers to distributed
computing and from databases to charts.
}
@ -347,9 +344,8 @@ computing and from databases to charts.
@columns[3 style: "text-color: black"]{
@h2[style: "font-size: 180%; margin-bottom: 10pt"]{News}
@p{Racket version 5.3.5 has been released.}
@p{Racket videos are now available.}
@p{@a[href: "racketcon.html"]{RacketCon 2013} will be in September in Boston.}}}
@p{Racket version 5.6 has been released.}
@p{@a[href: "racketcon.html"]{RacketCon 2014} will be in September in St Louis.}}}
@columns[12 #:row? #t #:center? #t style: "text-align:justify;font-size: 120%; margin-top: 20pt; "]{
@ -418,7 +414,7 @@ provides comprehensive coverage of all of Racket.}
server} to build dynamic web applications.}
@docelem["Package Management" "Racket" "http://docs.racket-lang.org/pkg/"]{
explains how to install
@a[href: "https://pkg.racket-lang.org"]{packages}, and how to
@a[href: "http://pkgs.racket-lang.org"]{packages}, and how to
build and distribute your own.}}
}
@ -427,24 +423,25 @@ explains how to install
@row{
@columns[4]{
@panetitle{News & Events}
@p{@a[href: "racketcon.html"]{RacketCon} the annual
@p{@a[href: "racketcon.html"]{RacketCon} The annual
Racket meeting, coming up in September. Previously
in @a[href: "http://con.racket-lang.org/2012"]{2012}
and @a[href: "http://con.racket-lang.org/2012"]{2011}.}
in @a[href: "http://con.racket-lang.org/2013"]{2013},
@a[href: "http://con.racket-lang.org/2012"]{2012},
and @a[href: "http://con.racket-lang.org/2011"]{2011}.}
@p{@a[href: "http://blog.racket-lang.org/"]{Blog}
announcements, helpful hints, and thoughtful rants.}
Announcements, helpful hints, and thoughtful rants.}
@p{@a[href: "http://twitter.com/#!/racketlang"]{Twitter}
short bits of Racket news.}
Short bits of Racket news.}
}
@columns[4]{
@panetitle{Discussion}
@p{@a[href: "http://lists.racket-lang.org/"]{Mailing lists}
discussion for using and developing Racket.}
Discussion lists for using and developing Racket.}
@p{@a[href: "http://racket-lang.org/irc-chat.html"]{IRC}
Chat in the @tt[style: "background-color: #d8d8e8;"]{@big{@strong{#racket}}} channel on
@a[href: "http://freenode.net"]{@tt{freenode.net}} an informal
@a[href: "http://freenode.net"]{@tt{freenode.net}} An informal
discussion channel for all things related to Racket.
(@a[href: "https://botbot.me/freenode/racket/"]{Browse the logs}.)}
@ -457,7 +454,7 @@ The people behind Racket.}
@columns[4]{
@panetitle{Contributing}
@p{@a[href: "https://github.com/plt/racket/"]{Code}
the Racket source code on GitHub.}
The Racket source code on GitHub.}
@p{@a[href: "https://github.com/plt/racket/wiki"]{Wiki}
Useful pages
include @a[href: "https://github.com/plt/racket/wiki/Intro-Projects"]{Intro
@ -468,49 +465,49 @@ Useful pages
The freshest versions of Racket.}
@p{@a[href: "http://bugs.racket-lang.org"]{Bug reports}
File, query and maybe fix existing reports.}}}
File, query, and maybe fix existing reports.}}}
@sectitle{Learning}
@row{
@row{
@book-image{
@a[href: "http://www.htdp.org"]{@img[src: (copyfile (in-here "img/htdp-cover.gif"))]}}
@a[href: "http://www.htdp.org"]{@img[src: (copyfile #:site www-site (build-path img-dir "htdp-cover.gif"))]}}
@columns[4]{@panetitle{How to Design Programs}
@p{A principled approach to program design}
@p{A principled approach to program design.}
@ul{
@li{Teaching language support built-in to DrRacket}
@li{Aimed at the programming novice}}}
@li{Teaching language support is included with DrRacket.}
@li{Aimed at the programming novice.}}}
@columns[4]{@panetitle{Realm of Racket}
@p{Learn Racket and programming, one game at a time}
@p{Learn Racket and programming, one game at a time/}
@ul{
@li{Sample game code comes with the Racket distribution}
@li{For those just starting out with Racket}
@li{Sample game code comes with the Racket distribution.}
@li{For those just starting out with Racket.}
}}
@book-image{
@a[href: "http://www.realmofracket.com"]{@img[src: (copyfile (in-here "img/racket_cover_web.png"))]}}
@a[href: "http://www.realmofracket.com"]{@img[src: (copyfile #:site www-site (build-path img-dir "racket_cover_web.png"))]}}
}}
@row{
@row{
@book-image{
@a[href: "http://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/"]{
@img[src: (copyfile (in-here "img/plai-cover.jpg"))]}}
@img[src: (copyfile #:site www-site (build-path img-dir "plai-cover.jpg"))]}}
@columns[4]{@panetitle{PLAI}
@p{Foundations of programming languages}
@ul{
@li{Understand the features that make languages tick}
@li{For undergraduates, graduate students, and experts}}}
@li{Understand the features that make languages tick.}
@li{For undergraduates, graduate students, and experts.}}}
@columns[4]{@panetitle{Semantics Engineering with PLT Redex}
@p{Lightweight automation for semantics}
@p{Lightweight automation for semantics.}
@ul{
@li{Model your own programming language semantics}
@li{For the working language engineer}
@li{Model your own programming language semantics.}
@li{For the working language engineer.}
}}
@book-image{
@a[href: "http://redex.racket-lang.org/"]{@img[src: (copyfile (in-here "img/redex-cover.jpg"))]}}
@a[href: "http://redex.racket-lang.org/"]{@img[src: (copyfile #:site www-site (build-path img-dir "redex-cover.jpg"))]}}
}}
})
@ -539,8 +536,8 @@ File, query and maybe fix existing reports.}}}
(set! button-ids+labels (cons (cons id txt) button-ids+labels))
(a href: "#" id: id onclick: (list onclick "; return false;") title: tip
nbsp)) ; empty, filled by JS code, so JS-less browsers won't see it
;(define next (img src: (copyfile (in-here "img/next.png")) width: 10))
;(define prev (img src: (copyfile (in-here "img/prev.png")) width: 10))
;(define next (img src: (copyfile #:site www-site (build-path img-dir "next.png")) width: 10))
;(define prev (img src: (copyfile #:site www-site (build-path img-dir "prev.png")) width: 10))
(for/list ([elem (in-list l)] [pos (in-naturals)])
@ -622,14 +619,14 @@ File, query and maybe fix existing reports.}}}
;; TODO
;; (define screenshots
;; (let ([image (copyfile (in-here "screenshot.jpg"))])
;; (let ([image (copyfile #:site www-site (in-here "screenshot.jpg"))])
;; @a[href: screenshots]{
;; @img[src: image alt: "[screenshots]" border: 0
;; style: "margin-bottom: 2px;"]@;
;; @|br|@small{Screenshots}}))
;; (define tour-video
;; (page #:title "DrRacket Tour" #:file "tour.html"
;; (page #:site www-site #:title "DrRacket Tour" #:file "tour.html"
;; (define (center . body)
;; (table align: 'center style: "margin: 3em 0em;"
;; (tr (td align: 'center body))))
@ -644,19 +641,22 @@ File, query and maybe fix existing reports.}}}
;; resources that are specific to the front page
(define loud (copyfile (in-here "img/loud.png")))
@;(define loud (copyfile #:site www-site (build-path img-dir "loud.png")))
(define more.css
@plain[#:referrer (λ (url) (link rel: "stylesheet" type: "text/css"
@plain[#:site www-site
#:referrer (λ (url) (link rel: "stylesheet" type: "text/css"
href: url title: "default"))]{
@; TODO: from here to END it's css that should probably be removed;
@; after that it's all scribble stuff.
@;{
.bodycontent {
background-image: url('@loud');
background-repeat: no-repeat;
background-position: center top;
}
}
.leftpane {
font-size: medium;
float: left;

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
(require "resources.rkt")
@ -6,18 +6,21 @@
"http://webchat.freenode.net?channels=racket&uio=OT10cnVlJjExPTIzNg6b")
(define irc-chat
@page[#:title "IRC" #:part-of 'community]{
@page[#:site www-site #:title "IRC" #:part-of 'community]{
@iframe[src: webchat-link width: "100%" height: "400"]})
(define log-header+footer
(lazy (regexp-split #rx"{{{BODY}}}"
(xml->string @page[#:id 'browse-downloads
(xml->string @page[#:site www-site
#:id 'browse-downloads
#:html-only #t
#:part-of 'community
"{{{BODY}}}"]))))
(define header @plain[#:file "irc-logs/dummy/HEADER.html" #:newline #f
(define header @plain[#:site www-site
#:file "irc-logs/dummy/HEADER.html" #:newline #f
(car (force log-header+footer))])
(define footer @plain[#:file "irc-logs/dummy/README.html" #:newline #f
(define footer @plain[#:site www-site
#:file "irc-logs/dummy/README.html" #:newline #f
(cadr (force log-header+footer))])
(provide irc-logs)
@ -25,7 +28,8 @@
(let ([base "/home/scheme/irc-logs"])
(define t (make-hash))
(λ (type . text)
(hash-ref! t type (λ() (a href: (symlink (format "~a/~a" base type)
(hash-ref! t type (λ() (a href: (symlink #:site www-site
(format "~a/~a" base type)
(format "irc-logs/~a" type))
text))))))
(void (irc-logs ".htaccess"))

View File

@ -1,10 +1,12 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "people.rkt" "techreports.rkt" "old-techreports.rkt" "gumby.rkt")
(require plt-web/style
"resources.rkt" "people.rkt" "techreports.rkt" "old-techreports.rkt")
(provide learning)
(define learning
@page[#:window-title "Racket Learning" #:part-of 'learning #:width 'full
@page[#:site www-site
#:window-title "Racket Learning" #:part-of 'learning #:width 'full
#:description
'@{Racket-related learning resources. Introductions to Racket, @;
the Racket Guide, Computer Science textbooks that use Racket, @;
@ -34,7 +36,8 @@
@|graduate-study|.}]}})
(define graduate-study
@page[#:file "common-plt-app.html" #:part-of 'learning]{
@page[#:site www-site
#:file "common-plt-app.html" #:part-of 'learning]{
@(define (box-style border-width color)
@list{border: @|border-width|px solid black; padding: 5px; @;
background: @|color|@";"})
@ -96,7 +99,8 @@
;; redirection page for the previous name of this page
(define outreach+research
@page[#:part-of 'learning
@page[#:site www-site
#:part-of 'learning
#:title "Outreach & Research"
#:link-title @list{Outreach@|nbsp|&@|nbsp|Research}
#:extra-headers

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
(require "resources.rkt")
@ -44,7 +44,8 @@
(apply div class: 'nested text))
(define new-name
@page[#:title "From PLT Scheme to Racket"]{
@page[#:site www-site
#:title "From PLT Scheme to Racket"]{
@styles
@heading{PLT Scheme is a Racket}

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
;; Old style TR entries
@ -446,7 +446,8 @@
[note ,@note]))))
(define old-techreports
@page[#:file "techreports/" #:title "Old PLT Technical Reports"
@page[#:site www-site
#:file "techreports/" #:title "Old PLT Technical Reports"
#:part-of 'learning
#:extra-headers
@script/inline[type: "text/javascript"]{

View File

@ -1,6 +1,6 @@
#lang meta/web
#lang plt-web
(require "resources.rkt" "gumby.rkt")
(require "resources.rkt" plt-web/style)
(define (make-all place person)
;; The first person in a place is the one responsible for it
@ -102,7 +102,8 @@
(provide people)
(define acks-url "https://github.com/plt/racket/blob/master/racket/collects/acks/acks.rkt")
(define people
@page[#:window-title "Racket People: The PLT Group" #:part-of 'community
@page[#:site www-site
#:window-title "Racket People: The PLT Group" #:part-of 'community
#:description "PLT: the group that is the Racket development team."
#:width 'full]{
@columns[8 #:center? #t #:row? #t]{

View File

@ -0,0 +1,13 @@
#lang plt-web
(require plt-web/style)
(provide www-site)
(define www-site
(site "www"
#:navigation
(list
@a[href: "http://pkgs.racket-lang.org"]{Packages}
@a[href: "http://docs.racket-lang.org"]{Documentation}
@a[href: "http://blog.racket-lang.org"]{Blog}
@navigation-button[@(a href: (resource "download/" #f) "Download")])))

View File

@ -1,4 +1,4 @@
#lang meta/web
#lang plt-web
;; New style TR entries
@ -47,7 +47,7 @@
@list{@h4{@title}
@blockquote{@PRE{@body}}})
(define cite-page
@page[#:file (format "tr~a/" num) #:title tr-name #:part-of 'learning]{
@page[#:site www-site #:file (format "tr~a/" num) #:title tr-name #:part-of 'learning]{
@h3{@title-line[#f]}
@p*{@blockquote{@big{@content}}
@~ For citations of the @desc, please use @TT{\cite{plt-tr@num}} in
@ -92,7 +92,7 @@
(provide techreports)
(define techreports
@page[#:file "tr/" #:title "PLT Technical Reports" #:part-of 'learning]{
@page[#:site www-site #:file "tr/" #:title "PLT Technical Reports" #:part-of 'learning]{
@p*{
@~ For citations of generic pieces of the Racket infrastructure, please use
@TT{\cite{plt-tr1}}, @TT{\cite{plt-tr2}}, etc. in LaTeX, or

View File

@ -1,10 +1,10 @@
#lang meta/web
#lang plt-web
(require "resources.rkt")
(provide web-copyright)
(define web-copyright
@page{
@page[#:site www-site]{
The text of this website is available for modification and reuse
under the terms of the Creative Commons Attribution-Sharealike 3.0
Unported License and the GNU Free Documentation

View File

@ -0,0 +1,676 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -0,0 +1,10 @@
plt-web-doc
Copyright (c) 2010-2014 PLT Design Inc.
This package is distributed under the GNU Lesser General Public
License (LGPL). This means that you can link Racket into proprietary
applications, provided you follow the rules stated in the LGPL. You
can also modify this package; if you distribute a modified version,
you must distribute it under the terms of the LGPL, which in
particular means that you must release the source code for the
modified software. See COPYING_LESSER.txt for more information.

View File

@ -0,0 +1,15 @@
#lang info
(define collection "plt-web")
(define pkg-desc "documentation part of \"plt-web\"")
(define pkg-authors '(eli mflatt samth))
(define deps '("base"
"plt-web-lib"
"racket-doc"
"scribble-doc"
"scribble-lib"))
(define scribblings '(("plt-web.scrbl")))

View File

@ -0,0 +1,261 @@
#lang scribble/manual
@(require scribble/bnf
(for-label (except-in racket/base #%top #%module-begin)
scribble/html
plt-web))
@(define (tag . s) @tt{<@|s|>})
@title{Creating PLT-Style Web Pages}
@defmodulelang[plt-web]{The @racketmodname[plt-web] language builds on
@racketmodname[scribble/html] for generating pages in the same style
as @url["http://racket-lang.org/"].}
Unlike @racketmodname[scribble/html], the values of expressions in a
@racketmodname[plt-web] module are not treated as HTML. Instead,
top-level expressions in @racketmodname[plt-web] are as in
@racket[racket/base].
Meanwhile, a @racket[main] submodule is added that runs
@racket[render-all] (after parsing command-line arguments) to render
all registered resources, including HTML pages. Pages are meant to be
registers through a @racket[page] form that is defined by a
@racket[define-context] or @racket[define+provide-context] declaration
that configures a particular site (i.e., collection of pages).
@; ----------------------------------------
@section{Configuring a Site}
A site is identifiers by a relative directory path, which determines
where the site's content is generated. For a non-local build, the
relative directory is mapped to a destination URL via
@racket[url-roots].
@defproc[(site [dir path-string?]
[#:url url (or/c string? #f) #f]
[#:resources resources (or/c #f
((or/c symbol? path-string?) . -> . any/c))
#f]
[#:page-style? page-style? any/c #t]
[#:robots robots (or/c #f #t outputable/c) #t]
[#:htaccess htaccess (or/c #f #t outputable/c) #t]
[#:navigation navigation (listof outputable/c) null])
site?]{
Creates a value that represents a site. If @racket[url] is not
@racket[#f], then it will be registered to @racket[url-roots] for a
build in web mode (as opposed to local mode).
The @racket[resources] procedure determines a mapping from an abstract
(symbol) or concrete (path) resource to the content or references to
the resource. Normally, and when @racket[#f] is provided as
@racket[resources], the resource mapping is computed automatically
based on the default page style and arguments such as @racket[robots],
@racket[htaccess], and @racket[navigation]. A resource-mapping
function must support at least the following arguments:
@itemlist[
@item{@racket['preamble] : @racket[outputable/c] --- content to precede
the @tag{html} tag, such as @racket[(doctype 'html)].}
@item{@racket['postamble] : @racket[outputable/c] --- content to
follow the rest of the page content (after the @tag{body}
tag).}
@item{@racket['headers] : @racket[outputable/c] --- content to
included in the @tag{head} tag.}
@item{@racket['make-navbar] : @racket[(any/c . -> . outputable)] ---
given the destination page, produces content to precede the
rest of the page content (within the @tag{body}
tag).}
@item{@racket['icon-headers] : @racket[outputable/c] --- content to
specify a ``favicon'' for the page, included already
in @racket['headers] content.}
@item{@racket['style-path] : @racket[outputable/c] --- reference to a
resource for the page's CSS, included already in
@racket['headers] content.}
@item{@racket['logo-path] : @racket[outputable/c] --- reference to a
resource for a logo, included already in @racket['headers]
content.}
@item{@racket['icon-path] : @racket[outputable/c] --- reference to a
resource for a ``favicon'', included already in
@racket['icon-headers] content.}
]
If @racket[page-style?] is true, then the default resource-mapping
function for the site includes content to set the style of the overall
page. Otherwise, only sufficient resources and content are included to
specify the style of the PLT web-page header (i.e., a bar with the
Racket logo).
The @racket[robots] and @racket[htaccess] arguments determine robot
and access information included by the default resource-mapping
function. A @racket[#t] value enables normal access, a @racket[#f]
value disables access, and any other value is used as the
corresponding specification.
The @racket[navigation] argument determines content (usually links) to
be included in the PLT header. Currently, up to four such links are
supported.}
@defproc[(site? [v any/c]) boolean?]{
Returns @racket[#t] if @racket[v] represents a site, @racket[#f] otherwise.}
@defproc[(site-dir [s site?]) path-string?]{
Extracts the destination directory of @racket[s].}
@defproc[(site-resources [s site?]) ((or/c symbol? path-string?) . -> . any/c)]{
Extracts the resource-mapping function from @racket[s].}
@; ----------------------------------------
@section{Creating Site Content}
@defform[(page keyword-arg ... form ...)
#:grammar ([keyword-arg (code:line keyword expr)])]{
Equivalent to @racket[(page* keyword-arg ... (lambda () (begin/text form ...)))].}
@defproc[(page* [#:site s site?]
[#:html-only html-only? any/c #f]
[#:id id path-string? #f]
[#:file file (or/c path-string? #f) #f]
[#:title title string? (... id)]
[#:link-title link-title outputable/c title]
[#:window-title window-title string? (string-append "Racket: " label)]
[#:width width (or/c #f 'full outputable/c) #f]
[#:description description string? #f]
[#:extra-headers extra-headers outputable/c #f]
[#:extra-body-attrs body-attrs outputable/c #f]
[#:referrer referrer (string? outputable/c ... . -> . outputable/c)
(λ (url . content)
(a href: url (if (null? content) linktitle content)))]
[#:part-of part-of (or/c #f symbol?) #f]
[content outputable/c])
outputable/c]{
Registers an HTML page as a resource (via @racket[resource]) and
returns a value that can be used to refer to the page within another
resource, assuming that @racket[html-only?] is @racket[#f]. If
@racket[html-only?] is true, then the result represents HTML for the
page, instead of a way to reference the page, and no resource is
registered.
The page is generated as part of the site @racket[s], and either an
@racket[id] or @racket[file] must be provided to identify the page
within the site. Furthermore, either @racket[id] or @racket[title]
must be provided to determine the page's title.
The @racket[link-title] and @racket[window-title] arguments control
separate the title of the page as used by references and for the page
as viewed.
The @racket[width] argument determines the page wide: @racket[#f] is
the default, @racket['full] is full width, and any other value is used
as a CSS width.
The @racket[description] argument provides a meta tag for the page.
The @racket[part-of] argument determines where the page resides in a
larger site when the layout uses a global navigation bar (but the
current format does not use a navigation bar in that sense).}
@defform[(plain keyword-arg ... form ...)
#:grammar ([keyword-arg (code:line keyword expr)])]{
Equivalent to @racket[(plain* keyword-arg ... (lambda () (begin/text form ...)))].}
@defproc[(plain* [#:site s site?]
[#:id id path-string? #f]
[#:suffix suffix (or/c #f string?) #f]
[#:file file (or/c path-string? #f) #f]
[#:referrer referrer (string? outputable/c ... . -> . outputable/c)
(λ (url . content)
(a href: url (if (null? content) linktitle content)))]
[#:newline newline? any/c #t]
[content outputable/c])
outputable/c]{
Like @racket[page*], but for a resource that is a plain file.}
@deftogether[(
@defproc[(copyfile [#:site s site?]
[src path-string?]
[dest string? (basename src)])
outputable/c]
@defproc[(symlink [#:site s site?]
[src path-string?]
[dest string? (basename src)])
outputable/c]
)]{
Registers a resource that is either a copy of a file or a symbolic link,
returning a value that can be used to reference the resource.}
@; ----------------------------------------
@section{Generating Site Content}
To generate web pages from a @racket[plt-web] module, run the module,
typically with a @Flag{o} flag to specify the output directory. For
example, if @filepath{pages.rkt} is the module, then
@commandline{racket pages.rkt -o /tmp/pages}
builds the output to a @filepath{/tmp/pages} directory.
The command-line flags are recognized by the @racket[main] submodule
that is introduced by @racketmodname[plt-web]:
@itemlist[
@item{@Flag{w} or @DFlag{web} --- Build output in deployment mode, where references
within a top-level site use relative paths, but references
across top-level sites use absolute URLs. This mode is the
default.}
@item{@Flag{l} or @DFlag{local} --- Build output in local mode, where
all references use relative paths, exploiting the fact that
sites are rendered in adjacent directories within the output
directory. (You may need to deal with an occasional manual
selection of @filepath{index.html} when viewing local output.)}
@item{@Flag{o} @nonterm{dir} or @DFlag{output} @nonterm{dir} ---
Writes output to subdirectories of @nonterm{dir}, which
defaults to the current directory. All existing files and
directories within @nonterm{dir} will be deleted. As a safety
check, the destination directory must not be within an
installed package.}
@item{@Flag{f} or @DFlag{force} --- Overwrite files in the destination
directory.}
@item{@PFlag{e} @nonterm{path} or @DPFlag{extra} @nonterm{path} ---
Require the module @nonterm{path} before running
@racket[build-all]. This flag can be used multiple times.}
]
@; ----------------------------------------
@section{Utilities}
@defproc[(basename [p path-string?]) string?]{
Extracts a file name from a path.}

View File

@ -0,0 +1,676 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -0,0 +1,10 @@
plt-web-lib
Copyright (c) 2010-2014 PLT Design Inc.
This package is distributed under the GNU Lesser General Public
License (LGPL). This means that you can link Racket into proprietary
applications, provided you follow the rules stated in the LGPL. You
can also modify this package; if you distribute a modified version,
you must distribute it under the terms of the LGPL, which in
particular means that you must release the source code for the
modified software. See COPYING_LESSER.txt for more information.

View File

@ -1,18 +1,12 @@
#!/bin/sh
#| -*- scheme -*-
exe="racket";
if [ -x "$PLTHOME/bin/racket" ]; then exe="$PLTHOME/bin/racket"; fi
exec "$exe" "$0" "$@"
|#
#lang racket/base
(require racket/cmdline racket/runtime-path racket/file scribble/html
"common/distribute.rkt" "config.rkt" "all.rkt")
pkg/path
"config.rkt"
"private/roots.rkt")
(define build-mode #f)
(define build-mode 'web)
(define output-dir (current-directory))
(define distribute? #f)
(define warn? #t)
(define extra-files '())
@ -23,7 +17,7 @@ exec "$exe" "$0" "$@"
" (all links are relative) "
(set! build-mode 'local)]
[("-w" "--web")
"web mode: create content that is viewable on the Racket web pages"
"web mode: create content that is viewable via HTTP"
(set! build-mode 'web)]
#:once-each
[("-o" "--output") dir
@ -35,28 +29,23 @@ exec "$exe" "$0" "$@"
[("-f" "--force")
"avoid warning about directory cleanup"
(set! warn? #f)]
[("-d" "--dist")
"distribute resulting content"
" (will only work with the right access to the servers)"
(set! distribute? #t)]
#:multi
[("-e" "--extra") extra
[("+e" "++extra") extra
"extra file to render more content"
(set! extra-files (cons extra extra-files))]
#:help-labels
" ** Note: set $KNOWN_MIRRORS_FILE to a file if you want to poll mirror"
" links (see top comment in \"download/mirror-link.rkt\").")
(set! extra-files (cons extra extra-files))])
(unless build-mode (raise-user-error 'build "build mode not specified"))
(define-runtime-path here ".")
(let ([build (file-or-directory-identity output-dir)])
(let loop ([dir here])
(if (equal? build (file-or-directory-identity dir))
(raise-user-error 'build
"might clobber sources, refusing to build (use `-o')")
(let-values ([(base name dir?) (split-path dir)])
(when base (loop base))))))
(let ([cache (make-hash)])
(define (check-dest p)
(when (path->pkg p #:cache cache)
(raise-user-error
'plt-web
"destination overlaps with package directories, refusing to build (use `-o')")))
(check-dest output-dir)
(for ([p (in-directory output-dir)])
(when (directory-exists? p)
(check-dest p))))
(parameterize ([current-directory output-dir])
(define paths (sort (map path->string (directory-list)) string<?))
@ -70,14 +59,14 @@ exec "$exe" "$0" "$@"
(raise-user-error 'build "Aborting."))))
(printf "Building ~a content...\n" build-mode)
(parameterize ([url-roots (and (eq? 'web build-mode) sites)])
(parameterize ([url-roots (if (eq? 'web build-mode)
(append (extra-roots)
sites)
(url-roots))])
(for ([extra (in-list extra-files)])
(if (file-exists? extra)
(dynamic-require `(file ,extra) #f)
(printf " ignoring missing extra file: ~a\n" extra)))
(parameterize ([current-directory output-dir])
(render-all)
(when distribute?
(printf "Distributing...\n")
(distribute (distributions)))))
(render-all)))
(printf "Done.\n")

View File

@ -0,0 +1,23 @@
#lang racket/base
(require "layout.rkt"
scribble/html)
(provide sites)
(define sites
'(("www" "http://racket-lang.org/")
("download" "http://download.racket-lang.org/")
("bugs" "http://bugs.racket-lang.org/")
("lists" "http://lists.racket-lang.org/")
("drracket" "http://drracket.org/")
;; stubs usually use absolute paths for resources, since they're
;; templates that often get used in sub-dir pages too
("stubs/planet" "http://planet.racket-lang.org/" abs)
("stubs/pre" "http://pre.racket-lang.org/" abs)
("stubs/git" "http://git.racket-lang.org/" abs)
("stubs/blog" "http://blog.racket-lang.org/" abs)
("stubs/mailman" "http://lists.racket-lang.org/" abs)
("stubs/dirlist" "http://download.racket-lang.org/" abs)
("stubs/docs" "http://docs.racket-lang.org/" abs)
("stubs/pkgs" "http://pkgs.racket-lang.org/" abs)
("stubs/wiki" "http://wiki.racket-lang.org/" abs)))

View File

@ -0,0 +1,11 @@
#lang info
(define collection "plt-web")
(define pkg-desc "PLT web page style and generation")
(define pkg-authors '(eli mflatt samth))
(define deps '("base"
"at-exp-lib"
"scribble-html-lib"))

View File

@ -1,7 +1,16 @@
#lang at-exp racket/base
(require scribble/html racket/dict (for-syntax racket/base syntax/name syntax/parse)
"utils.rkt" "resources.rkt")
"utils.rkt" "resources.rkt" "private/roots.rkt")
(provide page page*
plain plain*
copyfile
symlink
(rename-out [mk-site site])
site?
site-resources
site-dir)
(define-for-syntax (process-contents who layouter stx xs)
(let loop ([xs xs] [kws '()] [id? #f])
@ -39,25 +48,28 @@
;; for plain text files
(define-syntax (plain stx)
(syntax-case stx () [(_ . xs) (process-contents 'plain #'plain* stx #'xs)]))
(define (plain* #:id [id #f] #:suffix [suffix #f]
#:dir [dir #f] #:file [file #f]
(define (plain* #:site site
#:id [id #f] #:suffix [suffix #f]
#:file [file #f]
#:referrer [referrer values]
#:newline [newline? #t]
content)
(resource/referrer (get-path 'plain id file suffix dir)
(resource/referrer (get-path 'plain id file suffix (site-dir site))
(file-writer output (list content (and newline? "\n")))
referrer))
;; page layout function
(define-syntax (page stx)
(syntax-case stx () [(_ . xs) (process-contents 'page #'page* stx #'xs)]))
(define (page* #:id [id #f] #:dir [dir #f] #:file [file #f]
(define (page* #:site site
#:id [id #f]
#:file [file #f]
;; if this is true, return only the html -- don't create
;; a resource -- therefore no file is made, and no links
;; to it can be made (useful only for stub templates)
#:html-only [html-only? #f]
#:title [label (if id
(let* ([id (->string (force id))]
(let* ([id (format "~a" (force id))]
[id (regexp-replace #rx"^.*/" id "")]
[id (regexp-replace #rx"-" id " ")])
(string-titlecase id))
@ -70,17 +82,17 @@
#:description [description #f] ; for a meta tag
#:extra-headers [extra-headers #f]
#:extra-body-attrs [body-attrs #f]
#:resources resources0 ; see below
#:referrer [referrer
(λ (url . more)
(a href: url (if (null? more) linktitle more)))]
;; will be used instead of `this' to determine navbar highlights
#:part-of [part-of #f]
content0)
(define dir (site-dir site))
(define (page)
(define desc
(and description (meta name: 'description content: description)))
(define resources (force resources0))
(define resources (site-resources site))
(define header
(let ([headers (resources 'headers)]
[extras (if (and extra-headers desc)
@ -119,37 +131,31 @@
(case-lambda [(page) (hash-ref t page page)]
[(page part-of) (hash-set! t page part-of)])))
(provide set-navbar!)
(define-syntax-rule (set-navbar! pages top help)
(if (unbox navbar-info)
;; since generation is delayed, it won't make sense to change the navbar
(error 'set-navbar! "called twice")
(set-box! navbar-info (list (lazy pages) (lazy top) (lazy help)))))
(define (list-ref* l n d)
(if ((length l) . > . n)
(list-ref l n)
d))
(define navbar-info (box #f))
(define ((navbar-maker logo) this)
(define ((navbar-maker logo columns) this)
(define (icon name) @i[class: name]{})
(define (row . content) (apply div class: "row" content))
(define download-promise (dict-ref (force (first (unbox navbar-info))) 'download))
(define main-promise (force (second (unbox navbar-info))))
(define main-promise (resource "www/" #f))
@div[class: "navbar" gumby-fixed: "top" id: "nav1"]{
@div[class: "navbar gumby-content" gumby-fixed: "top" id: "nav1"]{
@row{
@a[class: "toggle" gumby-trigger: "#nav1 > .row > ul" href: "#"]{
@icon{icon-menu}}
@a[class: "five columns logo" href: (url-of main-promise)]{
@img[class: "logo" src: logo]}
@img[class: "logo" src: logo width: "198" height: "60" alt: "Racket"]}
@ul[class: "five columns"]{
@li{@a[href: "http://pkg.racket-lang.org"]{Packages}}
@li{@a[href: "http://docs.racket-lang.org"]{Documentation}}
@li{@a[href: "http://blog.racket-lang.org"]{Blog}}
@li{@div[class: "medium metro info btn icon-left entypo icon-install"]{
@download-promise}}}}})
@li{@(list-ref* columns 0 "")}
@li{@(list-ref* columns 1 "")}
@li{@(list-ref* columns 2 "")}
@li{@(list-ref* columns 3 "")}}}})
(define html-preamble
(define gumby-preamble
@list{
@doctype['html]
@; paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
@comment{[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]}
@comment{[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]}
@ -159,7 +165,7 @@
itemscope itemtype="http://schema.org/Product"> <!--<![endif]}
})
(define (make-html-postamble resources)
(define (make-gumby-postamble resources)
@list{
@||
@; Grab Google CDN's jQuery, with a protocol relative URL;
@ -168,7 +174,7 @@
"ajax/libs/jquery/1.9.1/jquery.min.js")]
@script/inline{
window.jQuery || document.write(@;
'<script src="/js/libs/jquery-1.9.1.min.js"><\/script>')}
'<script src=@(resources "jquery-1.9.1.min.js")><\/script>')}
@script[src: (resources "gumby.min.js")]
@script[src: (resources "plugins.js")]
@script[src: (resources "main.js")]
@ -181,7 +187,7 @@
@list{@link[rel: "icon" href: icon type: "image/ico"]
@link[rel: "shortcut icon" href: icon type: "image/x-icon"]})
(define (html-headers resources favicon)
(define (html-headers resources favicon page-style?)
(define style (resources 'style-path))
@list{
@meta[name: "generator" content: "Racket"]
@ -199,7 +205,9 @@
@; @link[rel: "stylesheet" href="css/minified.css"]
@; CSS imports non-minified for staging, minify before moving to
@; production
@link[rel: "stylesheet" href: (resources "gumby.css")]
@(if page-style?
@link[rel: "stylesheet" href: (resources "gumby.css")]
@link[rel: "stylesheet" href: (resources "gumby-slice.css")])
@;@link[rel: "stylesheet" href: (resources "style.css")]
@; TODO: Modify `racket-style' definition (and what it depends on)
@; in "resources.rkt", possibly do something similar with the new files
@ -211,21 +219,23 @@
@; a polyfill for min/max-width CSS3 Media Queries
@; For optimal performance, use a custom Modernizr build:
@; www.modernizr.com/download/
@script[src: (resources "modernizr-2.6.2.min.js")]
@(if page-style?
@script[src: (resources "modernizr-2.6.2.min.js")]
null)
})
(define (make-resources files)
(define (make-resources files navigation page-style?)
(define (resources what)
(case what
;; composite resources
[(preamble) html-preamble] ; not really a resource, since it's static
[(postamble) html-postamble]
[(preamble) preamble]
[(postamble) postamble]
[(headers) headers]
[(make-navbar) make-navbar] ; page -> navbar
[(icon-headers) icon-headers]
;; aliases for specific resource files
[(style-path) (resources "plt.css")]
[(logo-path) (resources "logo.png")]
[(logo-path) (resources "logo-and-text.png")]
[(icon-path) (resources "plticon.ico")]
;; get a resource file path
[else (cond [(assoc what files)
@ -233,55 +243,50 @@
=> (λ(f) (λ() (url-of (cadr f))))]
[else (error 'resource "unknown resource: ~e" what)])]))
(define icon-headers (html-icon-headers (resources 'icon-path)))
(define headers (html-headers resources icon-headers))
(define make-navbar (navbar-maker (resources 'logo-path)))
(define html-postamble (make-html-postamble resources))
(define headers (html-headers resources icon-headers page-style?))
(define make-navbar (navbar-maker (resources 'logo-path) navigation))
(define preamble (cons @doctype['html]
(if page-style? gumby-preamble null)))
(define postamble (if page-style? (make-gumby-postamble resources) null))
resources)
;; `define+provide-context' should be used in each toplevel directory (= each
;; site) to have its own resources (and possibly other customizations).
(provide define+provide-context define-context)
(define-for-syntax (make-define+provide-context stx provide?)
(syntax-parse stx
[(_ (~or (~optional dir:expr)
(~optional (~seq #:resources resources))
(~optional (~seq #:robots robots) #:defaults ([robots #'#t]))
(~optional (~seq #:htaccess htaccess) #:defaults ([htaccess #'#t])))
...)
(unless (attribute dir)
(raise-syntax-error 'define-context "missing <dir>"))
(with-syntax ([page-id (datum->syntax stx 'page)]
[plain-id (datum->syntax stx 'plain)]
[copyfile-id (datum->syntax stx 'copyfile)]
[symlink-id (datum->syntax stx 'symlink)]
[resources-id (datum->syntax stx 'the-resources)])
(with-syntax ([provides (if provide?
#'(provide page-id plain-id copyfile-id
symlink-id resources-id)
#'(begin))]
[resources
(or (attribute resources)
#'(make-resources
(make-resource-files
(λ (id . content)
(page* #:id id #:dir dir
#:resources (lazy resources-id)
content))
dir robots htaccess)))])
#'(begin
(define resources-id resources)
(define-syntax-rule (page-id . xs)
(page #:resources resources-id #:dir dir . xs))
(define-syntax-rule (plain-id . xs)
(plain #:dir dir . xs))
(define copyfile-id
(case-lambda [(s) (copyfile-resource s #:dir dir)]
[(s t) (copyfile-resource s t #:dir dir)]))
(define symlink-id
(case-lambda [(s) (symlink-resource s #:dir dir)]
[(s t) (symlink-resource s t #:dir dir)]))
provides)))]))
(define-syntax (define+provide-context stx)
(make-define+provide-context stx #t))
(define-syntax (define-context stx)
(make-define+provide-context stx #f))
(define (copyfile #:site site s [t (basename s)])
(copyfile-resource s t #:dir (site-dir site)))
(define (symlink #:site site s [t (basename s)])
(symlink-resource s t #:dir (site-dir site)))
(struct site (dir resources-promise)
#:constructor-name make-site)
(define (site-resources s)
(force (site-resources-promise s)))
(define mk-site
(let ([site
(lambda (dir
#:url [url #f]
#:robots [robots #t]
#:htaccess [htaccess #t]
#:navigation [navigation null]
#:page-style? [page-style? #t]
#:resources [resources #f])
(when url
(extra-roots (cons (list dir url)
(extra-roots))))
(define the-site
(make-site dir (delay
(or resources
(make-resources
(make-resource-files
(λ (id . content)
(page* #:id id
#:site the-site
content))
dir robots htaccess
(or page-style?
(pair? navigation)))
navigation
page-style?)))))
the-site)])
site))

View File

@ -0,0 +1,33 @@
#lang racket/base
(require (except-in scribble/html/lang #%module-begin)
"layout.rkt" "resources.rkt" "extras.rkt" "links.rkt" "utils.rkt")
(provide (all-from-out scribble/html/lang
"layout.rkt" "resources.rkt" "extras.rkt" "links.rkt")
basename web-path url-of ; from "utils.rkt"
(rename-out [module-begin #%module-begin]))
(define-syntax-rule (module-begin form ...)
(#%module-begin
form ...
(module main racket/base
(require plt-web/build))))
(module reader syntax/module-reader
plt-web/main
;; Similar to `#lang scribble/html', but with a plain scribble reader
;; (not the inside one).
#:read scribble:read
#:read-syntax scribble:read-syntax
#:info (web-reader-info)
(require (prefix-in scribble: scribble/reader))
(define (web-reader-info)
(lambda (key defval default)
(case key
[(color-lexer)
(dynamic-require 'syntax-color/scribble-lexer 'scribble-lexer)]
[else (default key defval)]))))

Some files were not shown because too many files have changed in this diff Show More