moe: html with style

[ bsd3, library, web ] [ Propose Tags ]
Versions [RSS] 2009.8.23, 2009.8.26, 2009.8.28, 2009.9.1, 2009.9.1.1, 2009.9.2, 2009.9.16, 2009.11.3, 2010.9.29, 2010.9.29.1, 2010.9.29.2, 2011.6.11, 2011.6.14, 2013.6.22, 2014.4.14, 2014.11.17, 2015.5.4
Change log changelog.md
Dependencies air (>=2013.6.22), base (>=4 && <99), bytestring, data-default, dlist, mtl, text [details]
License BSD-3-Clause
Author Jinjing Wang
Maintainer Jinjing Wang <nfjinjing@gmail.com>
Category Web
Home page https://github.com/nfjinjing/moe
Uploaded by JinjingWang at 2015-05-03T17:44:37Z
Distributions
Reverse Dependencies 3 direct, 1 indirect [details]
Downloads 11049 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-03 [all 1 reports]

Readme for moe-2015.5.4

[back to package description]

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>