[web-devel] Re: yesod stylesheet serving

Simon Michael simon at joyful.com
Mon Jul 5 16:56:36 EDT 2010


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:

     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..

> * On line 228, you use a non-breaking space. I'm not sure if you *need* 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.

> 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.

> [1] http://hackage.haskell.org/package/wai-handler-webkit

I'm looking forward to trying this.

More information about the web-devel mailing list