✂︎ TwoFold WIP

I’m still working on TwoFold (2✂︎f) v0.2, because v0.1 is not usable yet…

I added the option to define you own tag start and end characters to create fancy tags like: << whatever ? >>, or double tags like: [[ whatever >]] ... [[< whatever ]]. But I’m not sure I’ll keep this feature like this.

I’m passing the parameters that could come from the tags, into the transformer functions. So that works, but I’m blocked at parsing those options from the template tags. So if I would have a tag like: [[ foo bar=true qaz=1 qwerty="yes please" ]], I can’t parse that with a simple Regex …

So I’m looking at a flexible enough XML / HTML parser. I checked Parse5 (used by Reshape), HtmlParser2 (used by Cheerio) and HtmlJs-Parser (used by Marko). And Snapdragon (used by Breakdance). I kind of worked with all of them one way or the other, but not directly 😁

So I have to evaluate and decide if I’ll use one of them, or something else, or implement my own thing.

::⏳update:: I discovered Nearley.js and I think it might solve my parsing dilemma… I really hope so!

🏷 @notes #trinkets #twofold