moe

html with style https://github.com/nfjinjing/moe

Latest on Hackage:2015.5.4

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed by Jinjing Wang
Maintained by Jinjing Wang

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>

Changes

2010.9.29

Feature

  • new syntax for Moe2

2009.9.16

Feature

  • Thanks to eagletmt, self closing tags are possilbe

    • input
    • br
    • hr
    • meta
    • link

    are now self closing tags.

2009.9.2

Feature

  • use DList in writer to further boost performance, bytestring internal + DList is about as fast as it gets for writer monad

2009.9.1

Feature

  • use bytestring internally for performance
  • more markdown helper
  • add prim element tag, for no escape, but indented element

2009.8.25

Feature

  • revert element syntax
  • internal escape html function
  • escape both attribute and element body

2009.8.24

Init

comments powered byDisqus