Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Nemesis
Octocat-spinner-32 Setup.lhs
Octocat-spinner-32 changelog.md
Octocat-spinner-32 known-issues.md
Octocat-spinner-32 moe.cabal
Octocat-spinner-32 readme.md
readme.md

Moe: html with style

Example

first page

-- test.hs

import Prelude hiding ((/), (-), head, (>), (.), div)
import Air.Light ((-))
import Text.HTML.Moe2

test_page :: String
test_page = render -
  html - do
    head - do
      meta ! [http_equiv "Content-Type", content "text/html; charset=utf-8"] - (/)
      title - str "my title"
      link ! [rel "icon", _type "image/png", href "panda_icon.png"] - (/)

    body - do
      div ! [_class "container"] - do
        str "hello world"

main :: IO ()
main = putStrLn test_page

install and run

cabal update
cabal install moe

runghc test.hs

output:

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
      my title
    </title>
    <link rel="icon" type="image/png" href="panda_icon.png" />
  </head>
  <body>
    <div class="container">
      hello world
    </div>
  </body>
</html>
Something went wrong with that request. Please try again.