To explain in more detail, I had thought that Heist was a "slave" template library.
You hand it some attributes (nodes or strings) and a template name and it hands you back something (nodes or a rendered string). Currently, however, it seems as though Heist is the master app and mine ends up being the slave - you hand Heist a page shell and define some hooks and it does all the work and hands you the final string. Is that correct? If so, I'm still keen to use the library but will have to rethink how I am doing things as the work flow is in essence in the reverse order of what I am used to. Kevin --- On Thu, 6/17/10, Kevin Jardine <[email protected]> wrote: > From: Kevin Jardine <[email protected]> > Subject: Re: [Snap Framework] renderTemplate with XML fragments in Heist > To: "MightyByte" <[email protected]> > Date: Thursday, June 17, 2010, 4:34 PM > Thanks for your patience here! > > I am still running into a conceptual difficulty here as I > want to pass around a dictionary/map structure of some kind > of attribute value pairs. > > Eg. [(String, [Node])] or [(String,String)] which I can > manipulate in my own monad and then pass to Heist when and > if I choose. > > But bindSplice takes a function where I would want a > dictionary. > > I am obviously lacking in Heist-foo. > > What to do? > > Kevin > > --- On Thu, 6/17/10, MightyByte <[email protected]> > wrote: > > > From: MightyByte <[email protected]> > > Subject: Re: [Snap Framework] renderTemplate with XML > fragments in Heist > > To: "Kevin Jardine" <[email protected]> > > Date: Thursday, June 17, 2010, 3:55 PM > > Yeah, this was our intent. > > renderTemplate is the only way to get > > things out of TemplateMonad. By using bindSplice as > I > > mentioned > > above, you keep your data is structured nodes when > > possible. > > bindStrings is only intended as a convenient way to > pass > > strings into > > templates. > > > > On Thu, Jun 17, 2010 at 9:47 AM, Kevin Jardine <[email protected]> > > wrote: > > > Or am I making a conceptual error here? > > > > > > Perhaps I should be using runTemplate to get the > XML > > fragments and only use renderTemplate at the very top > > level? > > > > > > This would keep the input as structured nodes > and > > convert to bytestrings only at the last step. > > > > > > Kevin > > > > > > --- On Thu, 6/17/10, Kevin Jardine <[email protected]> > > wrote: > > > > > >> From: Kevin Jardine <[email protected]> > > >> Subject: renderTemplate with XML fragments > in > > Heist > > >> To: [email protected] > > >> Date: Thursday, June 17, 2010, 3:38 PM > > >> If I call > > >> > > >> renderTemplate (bindStrings dict > > emptyTemplateState) > > >> templateName > > >> > > >> this works fine if the dict values are all > > unstructured > > >> data. > > >> > > >> However, if they are XML structures, the > resulting > > HTML is > > >> escaped, presumably because bindStrings > inserts > > them as Text > > >> nodes. > > >> > > >> What function instead of bindStrings do I > call to > > insert > > >> XML fragments? > > >> > > >> Kevin > > >> > > >> > > >> > > >> > > > > > > > > > > > > _______________________________________________ > > > Snap mailing list > > > [email protected] > > > http://mailman-mail5.webfaction.com/listinfo/snap > > > > > > > > > _______________________________________________ Snap mailing list [email protected] http://mailman-mail5.webfaction.com/listinfo/snap
