Closed cemerick closed 2 years ago
FWIW, I've been using this in anger for a week or so, and it's working out quite nicely to emit htmx-flavoured HTML.
Any thoughts on the approach?
Sorry about the late response.
Interesting escape hatch. Why do you need a_unchecked
instead of just Unsafe.string_attrib
?
Since re
is already in the dependency cone, if your patch gets in, we definitely want to use that instead of str
. There is also already some snake-to-caml case conversion tooling somewhere (in /tools
maybe ?)
Interesting escape hatch. Why do you need
a_unchecked
instead of justUnsafe.string_attrib
?
Oh, maybe I don't. I didn't think to (re)use Unsafe
bits, but I guess that's what they're there for.
I'll tweak that up and swap Str
-> Re
.
I have updated my fork (and this PR) to:
Str
in favor of Re
(the case conversion stuff referenced /tools
isn't sufficient; inputs to that kebab_case
function can have a mix of kebab, snake, and camel case, alas)a_unchecked
and `Unchecked
additions, using Unsafe.string_attrib
instead. Hopefully my handling of the codegen in that case is reasonable (I didn't see any easy way to reuse any of the existing "parsers" there).I've updated to include top-level compilation of the necessary patterns, and added a section to the ppx/jsx docs.
(I haven't been able to "test" the latter though, as I had trouble getting the wikidoc to build; make
in the docs
directory does produce the API reference, but dies before it generates the narrative wiki content.)
Hopefully I didn't faff up the wiki documentation markup. :crossed_fingers:
Thanks @cemerick
Fixes #295
(also includes more generalized kebab-casing for attributes from jsx)