Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f2ec7609a0
Fetching contributors…

Cannot retrieve contributors at this time

file 109 lines (96 sloc) 4.309 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
-- Copyright 2010 Google Inc.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

module Index where

import DevUtils
import Tutorial
import Text.Html

page = devpage "Start"
        [ h1 << "Welcome aboard!"
        , p << "Barley is an environment and tutorial for exploring Haskell. \
\Our aim is to make your first encounter with Haskell fun, \
\enjoyable, and practical. "
        , steps
        ]
        [ modMessage, tutorialOutlineModule, modTagLine ]
        []


type Step = (String, [Html])

steps :: Html
steps = ordList $ map mkStep [step1, step2, step3, step4]
  where
    mkStep (title, text) = p << bold << title +++ thediv << text
    
step1 :: Step
step1 = ("Install and run Barley",
  [ p << "If you got here, you've done this step!"
  ])

step2 :: Step
step2 = ("Navigating Barley",
  [ p << "This web site is a small development envinronment for Haskell. \
\Here are the main navigation elements:"
  , p << (bold << "Top bar:" +++ "The black top bar at the very top of \
\the page has links to commonly used pages. At the top right, \
\Home takes you back to this page; Project takes you to a listing \
\of all the files that make up Barley. Documentation and Help are \
\what they say they are. In the upper left, the Haskell icon leads \
\to some common community web pages.")
  , p << (bold << "Right sidebar:" +++ "On the right there are useful operations. \
\On this page, it includes \
\a listing of the complete tutorial. On other pages there are actions \
\relevant to the page you are on. If you are on a tutorial page, that \
\is where the next and previous steps will be listed.")
  ])

step3 :: Step
step3 = ("A Sample Page",
  [ p << "If you want to try something right now, do this: "
  , unordList
      [ toHtml "Be sure you know how to get back here: The Home link in the upper right."
      , toHtml "Be sure to read all the comments in the code you are about to see. \
\This is where the instructions will be."
      , toHtml "Be brave."
      , toHtml "Now go to " +++ anchor ! [href "source?file=FirstPage.hs"] << "FirstPage.hs"
      , toHtml "Come back here when you're done."
      ]
  , p << "Congratulations! You're writing Haskell!"
  ])

step4 :: Step
step4 = ("Do the Tutorial",
  [ p << "The tutorial is a sequence of pages written in Barley. Some pages are \
\a sequence of slides, others are code that you will edit and work on."
  , p << "On the code pages, you should be sure to read the comments in the code, \
\since that is where the tutorial introduces new ideas, and guides you \
\along. On these pages you'll see a big Edit/Run switch near the top of \
\the page that will let you switch back and forth between editing the code \
\and viewing the page that that code renders."
  , p << ("Start here: "
          +++ anchor ! [href "source?file=Chapter1/Step_1_1.hs&preview=1"] << "Chapter 1, Step 1")
  ])
  
modMessage :: Html
modMessage = (h2 << "pre-Alpha version") +++
    (p << ("Just in case it wasn't totally clear: This is very early, \
\pre-Alpha software. We're making it up as fast as we can! \
\In the spirit of open source, we are developing in public, \
\so please be gentle!" +++ br +++ "— Johan & Mark"))

modSteps :: Html
modSteps = (h2 << "Tutorial Steps") +++
    ordList [ "Step", "Step", "Quick-Step", "Slide" ] +++
    p << "This will be a list of the steps some day…"

modTagLine :: Html
modTagLine = pre << (
    "webSite :: " +++ (bold << "Haskell") +++ "\n\
\webSite = madeWith\n\
\ [ haskellPlatform\n\
\ , snapFramework\n\
\ , plugins\n\
\ , ghc\n\
\ ]"
    )
Something went wrong with that request. Please try again.