I was pretty happy to learn about the web-server/templates package, which 
allows you to include the contents of a template file and have it dropped 
into the lexical context of the calling site. I’ve often wanted something 
like this so I could write only a single copy of things like headers and 
footers, and partials for listing chapters/articles in different contexts, 
etc.

I started fiddling with it in a Pollen project and, come to realize it was 
working even though I hadn’t `require`d or `provide`d any functions from 
web-server/template. How is this possible, I think. Some digging revealed 
that Pollen implements its own `include-template` function—and that it is 
provided automatically for code inside a Pollen template.

I guess this is cool? But

   - have you thought about including it in the docs? It’s pretty useful, 
   and the docs could also help avoid confusion among those who already know 
   about web-server/template. The docs do mention that include-template is 
   used behind the scenes but not that it's also available in Pollen 
   templates. With appropriate warnings about XSS concerns.
   - might it also be worth providing or reimplementing 
   web-server/template's `in` function? [2] (maybe it already does so, I 
   confess I haven’t checked yet) And then, perhaps including it in the docs 
   somewhere as well.
   - are there tradeoffs between the `include-template` provided by Pollen 
   and the one in web-server/template?


[1]: 
http://docs.racket-lang.org/web-server/templates.html#%28form._%28%28lib._web-server%2Ftemplates..rkt%29._include-template%29%29
[2]: 
http://docs.racket-lang.org/web-server/templates.html#%28form._%28%28lib._web-server%2Ftemplates..rkt%29._in%29%29

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pollenpub+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to