
Thanks!
On 7/5/10 12:59 PM, Michael Snoyman wrote:
* hamletToRepHtml handles the rendering, calling toContent, and wrapping in a RepHtml. So your line 120 could be rewritten as:
hamletToRepHtml$ template req msg as ps "hledger" s
Indeed - see line 121. When I comment 120 and uncomment 121 I get:
Hledger/Cli/Commands/WebYesod.hs:122:22: Couldn't match expected type `Hledger.Cli.Commands.WebYesod.R:RoutesHledgerWebApp' against inferred type `[Char]' Expected type: Routes HledgerWebApp -> String Inferred type: [Char] -> String In the second argument of `($)', namely `template req msg as ps "hledger" s' In the expression:
hamletToRepHtml $ template req msg as ps "hledger" s
Perhaps there's something else forcing the type, I haven't seen it yet..
There were a few places where you used the @-interpolation with strings, which resulted in the "Hamlet String" datatype. The first patch addresses
that, or are just trying to work around Yesod's whitespace rules. If the latter, there's a relatively new feature that allows you to put a backslash at the beginning of the content to bypass the whitespace rules.[3]
Interesting. I'm just forcing the account fields to be a bit indented here.
* I'm impressed to see you found the getMessage/setMessage API. I keep
meaning to blog about it, but haven't had a chance.
Yup, I have been digging through all docs. The above was just what I wanted.
* On line 212, I see you drop to plain XHTML syntax. If you just want to
get XHTML closing-tag rules and keep the Hamlet syntax, use "$xhamlet" instead of "$hamlet" at the beginning of your quasi-quoter.
I was happy when I realised you can write plain HTML in a hamlet template, if you want to. I'm not getting exactly what you meant above, but I'm sure I will soon.
All I meant is that Hamlet comes in multiple flavors: a plain HTML version by default, and an XHTML variant. It takes the exact same input, but
Let me know if you have any other questions, I've been interested in
hledger for a while now, so it's very gratifying to see it move over to Yesod.
Current status is hledger-darcs can be installed with -fweb (loli/hsp/hack/simpleserver) or -fwebyesod (yesod/hamlet/wai/simpleserver). I'm going to focus on the latter now, I just feel the need to keep the former around as yesod requires 6.12 and I'm always trying to reduce installation pain.
I agree with that decision, I was not happy upon realizing that Template Haskell for GHC 6.10 didn't support type families. I considered taking out
On Mon, Jul 5, 2010 at 11:56 PM, Simon Michael
[1] http://hackage.haskell.org/package/wai-handler-webkit
I'm looking forward to trying this.
Michael