Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created March 8, 2009 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abuiles/75852 to your computer and use it in GitHub Desktop.
Save abuiles/75852 to your computer and use it in GitHub Desktop.
markup = <div>
<% do l <- getViewDataValue_u "posts-list" ::View [(String,String,String,String)]
mapM indexItem l
%>
</div>
indexItem (i,t,b,d) = return $ cdata $ unlines $
["<div class=\"post\">"
,"<h2 class=\"title\">"++ t ++"</h2>"
,"<div class=\"entry\">"
,"<p>"++ b ++"</p>"
,"</div>"
,"<div class=\"meta\">"
,"<p class=\"byline\">Posted on "++ d ++"</p>"
,"<p class=\"links\"><a href=\"/Posts/Show/"++ i ++"\" class=\"comments\">Comments</a></p>"
,"</div>"
,"</div>"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment