Permalink
Browse files

First really rough cut of the Snap website running on Snap.

  • Loading branch information...
1 parent 78f0184 commit cbe93387aef539be33ec3343bbc7c421f78d28da @mightybyte mightybyte committed Apr 22, 2010
Showing with 313 additions and 744 deletions.
  1. +5 −1 .gitignore
  2. +30 −0 LICENSE
  3. +38 −0 snap-website.cabal
  4. +33 −0 src/Main.hs
  5. BIN {w2/site → static}/favicon.ico
  6. BIN {w2/site → static}/media/css/Aller_Rg.ttf
  7. BIN {w2/site → static}/media/css/DroidSerif-Regular.ttf
  8. BIN {w2/site → static}/media/css/PT_Sans.ttf
  9. BIN {w2/site → static}/media/css/bars.png
  10. BIN {w2/site → static}/media/css/bg-2.png
  11. BIN {w2/site → static}/media/css/hero-back.png
  12. BIN {w2/site → static}/media/css/holy-light.png
  13. +16 −1 {w2/site → static}/media/css/main.css
  14. BIN {w2/site → static}/media/css/paper.jpg
  15. BIN {w2/site → static}/media/css/sun-spots.png
  16. BIN {w2/site → static}/media/css/white-line.png
  17. BIN {w2/site → static}/media/img/logo-alt.png
  18. BIN {w2/site → static}/media/img/logo.png
  19. BIN {w2/site → static}/media/img/text-logo.png
  20. 0 {w1/lib → static/media}/js/init.js
  21. 0 {w2/site → static}/media/js/jquery-1.4.2.min.js
  22. +56 −0 templates/about.tpl
  23. +4 −0 templates/contribute.tpl
  24. +13 −0 templates/docs.tpl
  25. +37 −0 templates/download.tpl
  26. +2 −51 w2/site/index.html → templates/index.tpl
  27. +22 −0 templates/nav.tpl
  28. +4 −0 templates/news.tpl
  29. +53 −0 templates/page.tpl
  30. BIN w1/img/haskell.png
  31. BIN w1/img/snap.png
  32. +0 −80 w1/index.html
  33. 0 w1/lib/js/lib.js
  34. +0 −80 w1/lib/style/main.css
  35. +0 −11 w2/build.sh
  36. +0 −20 w2/builder.hs
  37. +0 −24 w2/env.conf
  38. 0 w2/site/media/js/init.js
  39. +0 −22 w2/site/templates/contributors.html
  40. +0 −11 w2/site/templates/footer.html
  41. +0 −17 w2/site/templates/header.html
  42. +0 −3 w2/site/templates/includes.html
  43. BIN w2/src/favicon.ico
  44. +0 −55 w2/src/index.html
  45. BIN w2/src/media/css/Aller_Rg.ttf
  46. BIN w2/src/media/css/DroidSerif-Regular.ttf
  47. BIN w2/src/media/css/PT_Sans.ttf
  48. BIN w2/src/media/css/bars.png
  49. BIN w2/src/media/css/bg-2.png
  50. BIN w2/src/media/css/hero-back.png
  51. BIN w2/src/media/css/holy-light.png
  52. +0 −160 w2/src/media/css/main.css
  53. BIN w2/src/media/css/paper.jpg
  54. BIN w2/src/media/css/sun-spots.png
  55. BIN w2/src/media/css/white-line.png
  56. BIN w2/src/media/img/logo-alt.png
  57. BIN w2/src/media/img/logo.png
  58. BIN w2/src/media/img/text-logo.png
  59. 0 w2/src/media/js/init.js
  60. +0 −154 w2/src/media/js/jquery-1.4.2.min.js
  61. +0 −22 w2/src/templates/contributors.html
  62. +0 −11 w2/src/templates/footer.html
  63. +0 −17 w2/src/templates/header.html
  64. +0 −3 w2/src/templates/includes.html
  65. +0 −1 www
View
@@ -5,4 +5,8 @@
.DS_Store
w2/builder
w2/builder.hi
-w2/builder.o
+w2/builder.o
+*.swp
+.hpc
+Setup.hs
+dist
View
30 LICENSE
@@ -0,0 +1,30 @@
+Copyright The Snap Team 2010
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of The Snap Team nor the names of other
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
@@ -0,0 +1,38 @@
+Name: snap-website
+Version: 0.1
+Synopsis: The Snap Framework Website
+Homepage: http://snapframework.com
+License: BSD3
+License-file: LICENSE
+Author: James Sanders, Gregory Collins, Doug Beardsley
+Maintainer: snap@snapframework.com
+Stability: Experimental
+Category: Web
+Build-type: Simple
+Cabal-version: >=1.2
+
+Executable snap-website
+ hs-source-dirs: src
+ main-is: Main.hs
+
+ Build-depends:
+ base >= 4,
+ haskell98,
+ transformers,
+ snap-core,
+ snap-server,
+ heist
+
+ -- Modules not exported by this package.
+ -- Other-modules:
+
+ -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.
+ -- Build-tools:
+
+ if impl(ghc >= 6.12.0)
+ ghc-options: -O2 -Wall -fhpc -fwarn-tabs -funbox-strict-fields
+ -threaded -fno-warn-unused-do-bind
+ else
+ ghc-options: -O2 -Wall -fhpc -fwarn-tabs -funbox-strict-fields
+ -threaded
+
View
@@ -0,0 +1,33 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Main where
+
+import Directory
+import System
+
+import Control.Applicative
+import Control.Monad.Trans
+import Snap.Http.Server
+import Snap.Types
+import Snap.Util.FileServe
+import Text.Templating.Heist
+
+site :: TemplateState IO -> Snap ()
+site ts =
+ ifTop (writeBS =<< liftIO (renderTemplate ts "index")) <|>
+ template "about" <|>
+ template "download" <|>
+ template "docs" <|>
+ template "contribute" <|>
+ template "news" <|>
+ fileServe "static"
+ where
+ template n = dir n (writeBS =<< liftIO (renderTemplate ts n))
+
+main :: IO ()
+main = do
+ args <- getArgs
+ templateState <- loadTemplates "templates"
+ httpServe "*" (read $ head args) "achilles"
+ (Just "access.log")
+ (Just "error.log")
+ (site templateState)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
@@ -157,4 +157,19 @@ li:before {
.newspaper p{
margin: 20px 0;
text-align: justify;
-}
+}
+
+div.nav {
+ text-align: center;
+}
+
+ul.nav {
+ padding: 0;
+ margin: 0;
+}
+
+ul.nav li {
+ list-style-type: none;
+ display: inline;
+}
+
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
View
@@ -0,0 +1,56 @@
+<snap:apply template="page">
+<h2>Snap Framework 0.1.1</h2>
+
+<p>This is the first developer prerelease of the Snap framework. Snap is
+a simple and fast web development framework and server written in
+Haskell. For more information or to download the latest version, you
+can visit the Snap project website at http://snapframework.com/.</p>
+
+
+<h3>Snap Status and Features</h3>
+
+This developer prerelease contains only the Snap core system, namely:
+
+<ul>
+ <li>a high-speed HTTP server, with an optional high-concurrency</li>
+ <li>backend using the <a href="http://software.schmorp.de/pkg/libev.html">libev</a> library</li>
+ <li>a sensible and clean monad for web programming</li>
+ <li>an xml-based templating system for generating HTML based on
+ <a href="http://expat.sourceforge.net/">expat</a> (via
+ <a href="http://hackage.haskell.org/package/hexpat">expat</a>) that allows you to
+ bind Haskell functionality to XML tags without getting PHP-style tag soup all over your pants</li>
+</ul>
+
+<p>Snap currently only runs on Unix platforms; it has been tested on
+Linux and Mac OSX Snow Leopard.</p>
+
+
+<h3>Snap Philosophy</h3>
+
+<p>Snap aims to be the *de facto* web toolkit for Haskell, on the basis
+of:</p>
+
+<ul>
+ <li>High performance</li>
+
+ <li>High design standards</li>
+
+ <li>Simplicity and ease of use, even for Haskell beginners</li>
+
+ <li>Excellent documentation</li>
+
+ <li>Robustness and high test coverage</li>
+</ul>
+
+<h3>Snap Roadmap</h3>
+
+<p>Where are we going?</p>
+
+<ol>
+<li> First prerelease: HTTP server, monad, template system</li>
+
+<li> Second prerelease: component system with a collection of useful stock modules (called "Snaplets") for things like user and session management, caching, an administrative interface, etc.</li>
+
+<li> Third prerelease: where we figure out what to do about data access</li>
+</ol>
+</snap:apply>
View
@@ -0,0 +1,4 @@
+<snap:apply template="page">
+ <h2>Contributing</h2>
+ <p>The Snap project welcomes contributors.</p>
+</snap:apply>
View
@@ -0,0 +1,13 @@
+<snap:apply template="page">
+ <h2>Tutorials</h2>
+ <ul>
+ <li>Quick Start</li>
+ <li>Needs to be written</li>
+ </ul>
+ <h2>API Documentation</h2>
+ <ul>
+ <li><a href="docs/snap-core/index.html">snap-core</a></li>
+ <li><a href="docs/snap-server/index.html">snap-server</a></li>
+ <li>heist</li>
+ </ul>
+</snap:apply>
View
@@ -0,0 +1,37 @@
+<snap:apply template="page">
+ <h2>Quick Start</h2>
+ <p>The quickest way to get Snap is with Haskell's Cabal. If you
+already have Cabal set up, then getting Snap is just two simple
+commands:</p>
+ <pre>
+ cabal update
+ cabal install snap-server
+ </pre>
+
+ <h2>Other Links</h2>
+ <table>
+ <tr>
+ <th>Package</th>
+ <th>Hackage</th>
+ <th>Source Repo</th>
+ </tr>
+ <tr>
+ <td>snap-core</td>
+ <td><a
+href="http://hackage.haskell.org/package/snap-core">http://hackage.haskell.org/package/snap-core</a></td>
+ <td>git clone snap@snapframework.com:snap-core</td>
+ </tr>
+ <tr>
+ <td>snap-server</td>
+ <td><a
+href="http://hackage.haskell.org/package/snap-server">http://hackage.haskell.org/package/snap-server</a></td>
+ <td>git clone snap@snapframework.com:snap-server</td>
+ </tr>
+ <tr>
+ <td>heist</td>
+ <td><a
+href="http://hackage.haskell.org/package/heist">http://hackage.haskell.org/package/heist</a></td>
+ <td>git clone snap@snapframework.com:heist</td>
+ </tr>
+ </table>
+</snap:apply>
@@ -1,35 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Snap: Haskell Web Framework</title>
- <meta name="author" content="The Snap Framework Team"/>
- <meta name="description" content="Snap Framework: a web framework for Haskell"/>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
- <meta http-equiv="content-style-type" content="text/css"/>
- </head>
- <body>
- <div id="main">
- <div id="header" class="content">
- <h1><img src="media/img/logo-alt.png" title="Snap Framework" /></h1>
- </div><!--end header-->
-
-
-<div id="hero-shot">
- <table class="content">
- <tr>
- <td class="cell-1">
-
- </td>
- </tr>
- </table>
-</div>
-
-<div class="content">
-
- <div class="newspaper">
-
+<snap:apply template="page">
<div id="about" class="section left">
<div class="inner">
<h2>What is the Snap Framework?</h2>
@@ -87,22 +56,4 @@
</div><!--end developers-->
</div><!--end project-status-->
- </div>
-
-</div><!--end content-->
-
- <div id="footer">
-
- </div><!--end footer-->
-
- </div><!--end main-->
-
- <link href="media/css/main.css" rel="stylesheet" type="text/css" />
-<script type="text/javascript" src="media/js/jquery-1.4.2.min.js"></script>
-<script type="text/javascript" src="media/js/init.js"></script>
-
-
- </body>
-</html>
-
-
+</snap:apply>
View
@@ -0,0 +1,22 @@
+<div class="nav">
+ <ul class="nav">
+ <li>
+ <a href="/">Home</a>
+ </li>
+ <li>
+ <a href="about">About</a>
+ </li>
+ <li>
+ <a href="download">Download</a>
+ </li>
+ <li>
+ <a href="docs">Docs</a>
+ </li>
+ <li>
+ <a href="contribute">Contribute</a>
+ </li>
+ <li>
+ <a href="news">News</a>
+ </li>
+ </ul>
+</div>
View
@@ -0,0 +1,4 @@
+<snap:apply template="page">
+ <h2>Snap News</h2>
+ <p>We're preparing our first release.</p>
+</snap:apply>
View
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>Snap: Haskell Web Framework</title>
+ <meta name="author" content="The Snap Framework Team"/>
+ <meta name="description" content="Snap Framework: a web framework for Haskell"/>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
+ <meta http-equiv="content-style-type" content="text/css"/>
+ </head>
+ <body>
+ <div id="main">
+ <div id="header" class="content">
+ <h1><img src="media/img/logo-alt.png" title="Snap Framework" /></h1>
+ </div><!--end header-->
+
+
+<div id="hero-shot">
+ <table class="content">
+ <tr>
+ <td class="cell-1">
+
+ </td>
+ </tr>
+ </table>
+</div>
+
+<snap:apply template="nav"/>
+
+<div class="content">
+
+ <div class="newspaper">
+
+ <content/>
+
+ </div>
+
+</div><!--end content-->
+
+ <div id="footer">
+
+ </div><!--end footer-->
+
+ </div><!--end main-->
+
+ <link href="media/css/main.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="media/js/jquery-1.4.2.min.js"></script>
+<script type="text/javascript" src="media/js/init.js"></script>
+
+
+ </body>
+</html>
+
+
View
Deleted file not rendered
View
Deleted file not rendered
Oops, something went wrong.

0 comments on commit cbe9338

Please sign in to comment.