I was just going to attempt this description, but I also +1 everything 
PMario just wrote.

It is very important to understand that the internal structure is a series 
of parsed trees:

*TW wikitext -> Parse Tree (AST) -> Widget Tree -> HTML*

I think a visual depiction of this would be incredibly useful for the 
community. Even the Parse-tree for a single tiddler in the Story List is 
very complex nested code, so even a micro-example of say, a $list with 
simple links to 3 other tiddlers (one of which has a `caption` field) would 
be a long example.

Best,

Joshua F

On Tuesday, May 12, 2020 at 7:16:09 AM UTC-7, Saq Imtiaz wrote:
>
> +1 for everything P Mario said.
>
> On Tuesday, May 12, 2020 at 4:13:04 PM UTC+2, PMario wrote:
>>
>> Hi, 
>>
>> Referring to my last post, I do think, the parser isn't the right place 
>> to do stuff like this, because the parser does something completely 
>> different. 
>>
>> TW parser converts wiki text syntax into a so called AST Abstract Syntax 
>> Tree <https://en.wikipedia.org/wiki/Abstract_syntax_tree>, which is an 
>> internal structure, that is kept in core memory only and is not available 
>> for end users. 
>>
>> It is available for plugin authors. The flow is like this
>>
>> TW wikitext -> Parse Tree (AST) -> Widget Tree -> HTML
>>
>> What you want is: TW wikitext -> AST -> TW wikitext
>>
>> So the AST could be modified and "*partially*" converted back to 
>> wikitext. ... BUT...  since TW AST doesn't contain text structure info eg: 
>> info about white-text (spaces / line-breaks) and comments it would be a 
>> rewrite of the tiddler source. ... So you will loose information.
>>
>> If you want to learn, how to modify TW wikitext, that way, without 
>> breaking it you'll need to understand how the relink-pluign 
>> <https://github.com/flibbles/tw5-relink> works. ... Be aware this plugin 
>> is highly sophisticated and has been a lot of work! So you'll need to be 
>> prepared to "dig down the rabbit-hole", which needs some time!
>>
>> *That's an other way to do it ;)*
>>
>> have fun!
>> mario
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4ca0211e-e673-481e-ac24-b9ca455d5d24%40googlegroups.com.

Reply via email to