Hello!
I just published my first draft of ModestEx, a Elixir/Erlang binding to lexborisov’s Modest library.
Modest is a fast HTML renderer implemented as a pure C99 library with no outside dependencies.
ModestEx exposes features to do pipeable transformations on html strings with CSS selectors, e.g. find(), prepend(), append(), replace() etc.
iex> ModestEx.find("<p><a>Hello</a> World</p>", "p a")
{:ok, "<a>Hello</a>"}
iex> ModestEx.serialize("<div>Hello<span>World")
{:ok, "<html><head></head><body><div>Hello<span>World</span></div></body></html>"}
The binding is implemented as a C-Node following the excellent example in @Overbryd 's package nodex. If you want to learn how to set up bindings to C/C++, you should definitely check it out.
Before that I experimented with a lot of other Html parser libraries like gumbo-parser, gumbo-query and GQ. I even implemented a binding package called gumbo_query_ex.
However Modest is currently the most active and most promising.
This project is under development!
Stay tuned for more features like ModestEx.remove
, ModestEx.prepend
, ModestEx.append
…
Tell me what you think
Best, F34nk