questions about hamlet syntax, and yesod-examples-.0.7.0.1

I'm using yesod 0.7.3, and I'm trying to change one of the yesod examples to match the structure created by the scaffolding utility. Here's the source of my confusion. This is what the sample hamlet file looks like generated from the scaffold utility !!! #{msg} ^{pageBody pc} But here's a sample of the syntax used by yesod-examples 0.7.0.1
instance Yesod Ajax where approot _ = "" defaultLayout widget = do Ajax pages _ <- getYesod content <- widgetToPageContent widget hamletToRepHtml [$hamlet| \<!DOCTYPE html>
<html> <head> <title>#{pageTitle content} <link rel="stylesheet" href="@{StaticR style_css}"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> <script src="@{StaticR script_js}"> \^{pageHead content} <body> <ul id="navbar"> $forall page <- pages <li> <a href="@{PageR (pageSlug page)}">#{pageName page} <div id="content"> \^{pageBody content} |]
This doesn't look like the same syntax to me. Am I right? How would I decouple the hamlet, as the scaffolding utility does?

It is the same syntax. The closing bracket, '>' is optional if there is no
inner text. The principle of hamlet is to make any redundant part of html
optional, and to remove closing tags in favor of indentation. We are
considering always using the closing bracket for examples to make It easier
to digest for newcomers. It also makes for easier use of some html syntax
highlighters (vim works well enough for me).
On Tue, Apr 12, 2011 at 4:04 PM, Michael Litchard
I'm using yesod 0.7.3, and I'm trying to change one of the yesod examples to match the structure created by the scaffolding utility. Here's the source of my confusion. This is what the sample hamlet file looks like generated from the scaffold utility
!!! #{msg} ^{pageBody pc}
But here's a sample of the syntax used by yesod-examples 0.7.0.1
instance Yesod Ajax where approot _ = "" defaultLayout widget = do Ajax pages _ <- getYesod content <- widgetToPageContent widget hamletToRepHtml [$hamlet| \<!DOCTYPE html>
<html> <head> <title>#{pageTitle content} <link rel="stylesheet" href="@{StaticR style_css}"> <script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> <script src="@{StaticR script_js}"> \^{pageHead content} <body> <ul id="navbar"> $forall page <- pages <li> <a href="@{PageR (pageSlug page)}">#{pageName page} <div id="content"> \^{pageBody content} |]
This doesn't look like the same syntax to me. Am I right? How would I decouple the hamlet, as the scaffolding utility does?
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
participants (2)
-
Greg Weber
-
Michael Litchard