Is there a plugin yet that eases the creation of Custom Parsers?
Use Case: I would love a TW Custom Parser.
Written, I guess, in JS (JavaScript / ECMA-###)
To provide any number of pairs of these regex string replacers …
Possibly related: Pretty fractions. It discussed two ways of adding parsing to wikitext. It sounds like Eric’s solution is what you need, but if you’re looking to do this at tiddler render time, those techniques may help.
I have also written parsers for data tiddlers by using list widget and filters to splitregexp[\n] then act on each line.
I suppose the issue is Parsers in one form or another is a common code pattern.
Deeper view;
As you may be aware a key parser function is used for wikitext. If you search shadows for parser you get to see the many already in use for example $:/core/modules/parsers/wikiparser/rules/dash.js depending on your skills cloning one of these and modifying the code you can make a new parser, however keep in mind it would take a lot of effort to make something you could share.
But I do like your idea of an easy parametrized parser, but it could be somewhat risky, to use.
I know “took a Deco”, “Have a Deco” but “useful to Deco” does not sound right for the lingo. The other references are “alien to me”, interesting in exposing me to other “cultures” close to my own. Although I did not watch “ello.ello” when it was on the Air, and had a French Partner since, and learned some of the Language so now it just not very funny for me, don’t get me wrong, I have had plenty of laughs with the language, for example “In France do people secretly piss in the piscine, or urinate in the urinoir”?
No Seriousely;
As illustrated by @buggyj what aspect of parser are you after?
Something that converts one thing to another at render time
Something to search and replace something with another
Both. I am after several things. All related to regex.
As far as the parser bit goes I’m most interested in seeing if I can get a parser that I can easily edit with multiple sets of transient “render” replacers. For short term use (to help me better, quicker, understand imported documents.)
@buggyj’s Flexity parser, which I used before, is extremely helpful to study.
I understand that you have a desired result. But this thought came to me;
So this would mean you have some text including wiki text and possibly TiddlyWiki Script, that as a rule is rendered a particular way. However you wish to provide a set of rules that transforms the text prior to rendering to generate a result with that set rules applied but don’t modify the underlying text.
These are on demand transformations “transient” and thus writing actual code parsers would be too demanding.
Would this not be equivalent to?;
copy the tiddler to a temp tiddler, apply multiple changes and render?
If necessary display the rendered tiddler as if it were in the source tiddler.