I'd enjoy a #lang that parses Jinja templates. They've proliferated to
all the major web languages and work nicely, so a Racketized version
seems like an obvious upgrade.
On Thu, Jan 4, 2018, at 3:23 PM, Matthew Butterick wrote:
>> On Jan 4, 2018, at 11:47 AM, Jay McCarthy
> On Jan 4, 2018, at 11:47 AM, Jay McCarthy wrote:
> FWIW, txexpr is essentially just `xexpr->string` but it sees when you
> put in a `script` or `style` and it puts the `make-cdata` for you. (It
> also does a bit more checking to make sure the xexpr is well-formed.)
David Storrs wrote on 01/04/2018 02:27 PM:
tor. 4. jan. 2018 kl. 17.48 skrev Matt Jadud :
> What is the best way to generate HTML from the webserver? I don't care
> about XML vs. HTML; I just want the fastest path to writing a small web
> application that solves a problem that I have, and part of that means
FWIW, txexpr is essentially just `xexpr->string` but it sees when you
put in a `script` or `style` and it puts the `make-cdata` for you. (It
also does a bit more checking to make sure the xexpr is well-formed.)
On Thu, Jan 4, 2018 at 2:30 PM, Philip McGrath wrote:
(For posterity, because I realized I didn't explicitly say this:)
The cdata structure effectively just tells functions like `write-xexpr` to
write the string it contains without any escaping. In particular, it
doesn't add the "" implied by using
CDATA in actual XML, which is what we take
Speaking of the html-writing module, I noticed this in the docs:
> "This is
> [Result is:] "This isbold italic text."
That does not seem like a correct result.
On 4 Jan 2018, at 19:07, Philip McGrath wrote:
> P.S.: I was very comfortable reading and writing HTML and XML-ish notation
> long before I came to Racket, and I initially resisted giving up my
> angle-brackets (to the extent of fiddling around with reader extensions),
> but I have
Many thanks for all of the responses. I have no fear of the parentheses,
and will likely end up with a number of wrappers like you describe,
Phillip. I hadn't (yet) twigged to possibly wrapping things up in a CDATA
section, but that makes sense.
Now if we just had a Racket library that shoveled
FWIW, I use `response/xexpr` in production with a `#:preamble` of `#"\n"`, and I haven't run into problems.
The biggest non-obvious thing, since I see you're generating a script
element, is that `response/xexpr` (and the underlying `xexpr->string`/`
write-xexpr`) properly escape < and & in body
What would the characteristics of the perfect library be?
Some easy things that come to mind:
- automatically generate the boilerplate -- DTD, tags, etc
- convenient methods for converting a LoL into a table
- able to "literate assemble" template fragments from the disk
On Thu, Jan 4, 2018 at
I don't think the perfect library exists, because HTML has changed
considerably since most Racket libraries were written.
I think xexpr do 90% of the job, but fails on the issues mentioned in
that issue. I think the best option right now is either
Mail list logo