nfjinjing / moe
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
moe /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Aug 25 10:09:26 -0700 2009 | |
| |
LICENSE | Wed Sep 16 09:42:33 -0700 2009 | |
| |
Nemesis | Sun Aug 23 10:59:56 -0700 2009 | |
| |
Setup.lhs | Sun Aug 23 10:59:56 -0700 2009 | |
| |
changelog.md | Tue Sep 15 21:04:44 -0700 2009 | |
| |
known-issues.md | Sun Aug 23 10:59:56 -0700 2009 | |
| |
moe.cabal | Tue Nov 03 11:20:20 -0800 2009 | |
| |
readme.md | Tue Sep 15 21:04:44 -0700 2009 | |
| |
src/ | Tue Nov 03 10:41:35 -0800 2009 |
readme.md
Moe: html with style
Example
first page
-- test.hs
import Prelude hiding ((/), (-), head, (>), (.), div)
import MPS.Light ((-))
import Text.HTML.Moe
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>
