Hi Chris,
As vnd.tiddlywiki includes html tags there is also the possibility to split
the parsing into two parts. The first part would be twc rules that produce
passive html then use innerHTML to extract the part-parsed text. This then
could be re-parsed with the remaining rules to add wiki-links and
transclusion (and what have you). I have experimented with something
similar here (an experimental extension to tw5,
http://tw5vocab.tiddlyspot.com), where I add wiki-links and transclusion to
markdown.
I have made a start to extract the parser from TWC, but it's a lot of
effort (pain in the A).
@Jeremy is there a link to your transliteration of the TWC parser?
On Monday, February 24, 2014 9:52:24 PM UTC+5:30, Chris Dent wrote:
>
> Hadn't been aware of this thread so sorry for joining late. pmario pointed
> it out from another posting. This sounds like a very good line to pursue.
> It would certainly be very nice if TiddlyWiki5 could render 5 and classic.
>
> Doesn't the issue of "sub collections of rules" being weird resolve
> appropriately if there are clean and strong boundaries between the
> tokenizer (which creates the AST) and a renderer which traverses the AST?
>
> If we say a source text is `text/vnd.tiddlywiki` then it contains text
> which matches a grammar and creates tokens which are always the same: this
> is em-text, this is hyperlink. What can change is how the renderer chooses
> to generate text from the AST. We can declare a renderer which renders
> em-text but leaves hyperlink as the raw source.
>
> So the issue then becomes if you want to have `text/x-tiddlywiki` as well,
> then it needs a grammar and a tokenizer.
>
> If you've got that then it would be possible to make a renderer which
> takes a `text/x-tiddlywiki` AST which can then be used to either generate a
> `text/vnd.tiddlywiki` AST _or_ `text/vnd.tiddlywiki` text.
>
> I'm making this all sound more simple than it actually will be though.
> TiddlyWiki Classic text is notoriously difficult to get a nice tree out of.
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.