Created
November 4, 2014 00:42
-
-
Save mango314/af77f5b50c679c81c9ea to your computer and use it in GitHub Desktop.
blaze-html example http://jaspervdj.be/blaze/tutorial.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- variant of tutorial | |
-- type "./notes" in terminal | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad (forM_) | |
import Text.Blaze.Html5 | |
import Text.Blaze.Html5.Attributes | |
import qualified Text.Blaze.Html5 as H | |
import qualified Text.Blaze.Html5.Attributes as A | |
import Text.Blaze.Renderer.String as S | |
notes :: Html | |
notes = docTypeHtml $ do | |
H.head $ do | |
H.title "John´ s Notes" | |
body $ do | |
p "Hello World" | |
main = putStrLn (S.renderHtml notes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html><head><title>John´ s Notes</title></head><body><p>Hello World</p></body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment