I was thinking that the dom tree would be constructed by 'a third party' 
lib (based on the old tw code), however it looks like your plugin could be 
easily updated. What do you think? was it working?

On Tuesday, February 25, 2014 1:26:02 PM UTC+5:30, Jeremy Ruston wrote:
>
> Hi BJ
>
> Here's a commit that includes the old TWC parser for TW5:
>
>
> https://github.com/Jermolene/TiddlyWiki5/tree/3d38d4add32a1cfebd9c331bc8772cc538710199/plugins/tiddlywiki/tw2parser
>
> > The first part would be twc rules that produce passive html then use 
> innerHTML to extract the part-parsed text
>
> I think the round trip into HTML text and out again might be inefficient. 
> Wouldn't it be better for the TWC parser to parse to an ordinary parse tree?
>
> Best wishes
>
> Jeremy
>
>
>
>
> On Tue, Feb 25, 2014 at 6:58 AM, BJ <[email protected] <javascript:>>wrote:
>
>>
>>
>>
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/tiddlywikidev.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Jeremy Ruston
> mailto:[email protected] <javascript:>
>  

-- 
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.

Reply via email to