How to investigate the rendering of a tiddler?

The discussion on what do we do first when wikitext does not work leads me to another one: is there a guide on how to investigate the rendering of a tiddler?

I mean:

  • is there several steps to render a tiddler (like replace macros, transclude, execute widgets, …)?
  • is there a simple way to get the full html code of a tiddler?
  • or stop after another previous step?
  • use breakpoints?

Hi @TartakOO you may find it useful to explore the “Internals” plugin that’s included in the official plugin library. It adds two new options to the preview menu when editing a tiddler.

The “parse tree” view shows how the text of a tiddler is interpreted into a tree of tokens. The “widget tree” view shows the tree of widgets that results from rendering a tiddler. The difference is that the parse tree just represents the contents of the tiddler itself; transclusions are represented as a transclude widget, but the target text is not included. Meanwhile, the widget tree shows the transclusion with the target content included. This stuff is unapologetically technically complex, but it is how works on the TiddlyWiki inside, and so even a superficial and incomplete understanding can be helpful.

1 Like

@TartakOO I meant to add that you might find some of the documentation on the TiddlyWiki Dev site helpful:

https://tiddlywiki.com/dev/#TiddlyWiki%20Architecture

It tries to explain the rendering pipeline that is at the heart of TiddlyWiki:

4 Likes
  • And yes the Internals plugins includes a raw HTML view which is the HTML so Generated

So depending on what you are looking for there may very well be a way

  • be warned you may see things you don’t understand because tiddlywiki needs to staqtify a lot of requirments, so dont get too hung up on them.
  • There are also
    • performance tools
    • The dumpvariables macro and my variation that allows filtered or selective viewing. my-custom-dumpvariables.json (672 Bytes)
    • Use the LogWidget to sent info to the JavaScript console
    • Oh, and of course the standard developer tools and/add ons will work on top of tiddlywiki.

Of course it can all depend on what information you are looking for or the questions you would like to ask, and you can just ask here in the forum.

2 Likes

Thanks guys, I will dig this.

@jeremyruston : I love TW, I have started to dump my brain into it, to customise it, and its dynamic nature allows me to do so much more than usual wikis; the learning curve is steep, but once you get it, magic starts to unfold.

1 Like

Thank you @TartakOO that’s good to hear. Do feel free to ask questions, the people here love to help!