The $tw object documented

67 views
Skip to first unread message

Luis Gonzalez

unread,
Jan 10, 2020, 5:37:49 AM1/10/20
to TiddlyWikiDev
I am collecting information about the $tw object. I have search in:
  • boot.js
  • $:/core/modules/utils/utils.js
  • $:/core/modules/utils/dom.js
  • $:/core/modules/wiki.js

But I don't know if there is more places where more functions are defined. Maybe you can help me.


Thanks!!
tw_object.pdf

Luis Gonzalez

unread,
Jan 10, 2020, 5:41:31 AM1/10/20
to TiddlyWikiDev
Look in the $:/core/modules/tiddler.js tiddler too!!!

PMario

unread,
Jan 10, 2020, 6:05:47 AM1/10/20
to TiddlyWikiDev
Hi,


It's a startup module, that initializes a lot of $tw object elements. In the source code it's eg: module-type: wikimethod ... So every source .js tiddler that has a field moudule-type with the content wikimethod is dynamically applied at startup.

The boot process only has the initialization that is needed to get the stuff going. ... You should really watch the video I linked to.

 - How do you analyse the code?
 - Which editor do you use?

mario

PMario

unread,
Jan 10, 2020, 6:12:23 AM1/10/20
to TiddlyWikiDev
Hi,

If you do a global search in the .js files for: modules.applyMethods  you can find all the places, that use a similar mechanism.

If you global search for module-type: you'll find the different types that are available. ... It finds 399 files ... BUT there are not that many module types.

https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FControlPanel%2FLoadedModules gives you a nice overview grouped by module-type eg: allfilteroperator is the first one.

Plugin authors are free to create their own module-types, if they need to.

-m

Luis Gonzalez

unread,
Jan 10, 2020, 6:33:31 AM1/10/20
to tiddly...@googlegroups.com
I use my personal computer sometimes and other computers of my work, so I have a pen whith some portable apps and some cloud documents (google, simplenote...).


I recent have downloaded the netbeans .zip IDE. You don't need to install anything. I use sometimes notepad++ or the atom editor. I use the Firefox debugger too. I draw with LibreOffice draw and Freeplane.

I read the code in this order:
  1. I start in empty.html. Here I see that the next files are bootprefix.js and boot.js
  2. I read bootprefix.js
  3. I read boot.js. There are some methods (in black color in my pdf)
  4. Then I realize that the next step are the startup module-type tiddlers inside TW, so I search them with this filter: "[all[shadows]module-type[startup]].
  5. I read some tiddlers and I annotate its methods (in red in the diagram)
  6. With this message I realized that there are other important module-type tiddlers: the wikimethod one. So I need other approach to search for all $tw object tree.
Maybe there is an easy way to search all $tw methods inside Tiddlywiki using filters, regexp and searches, but I don't know. I have to study it.

Now I have to change a little the chapters of The-book to register all I recently discover. I move very slowly for what it takes to publish a new version of The-book.


As soon as I have the opportunity and time I will watch the video. I really want to.
Thanks for your help

PMario

unread,
Jan 10, 2020, 6:37:43 AM1/10/20
to TiddlyWikiDev
On Friday, January 10, 2020 at 12:33:31 PM UTC+1, Luis Gonzalez wrote:
...
As soon as I have the opportunity and time I will watch the video. I really want to.

I think it's really worth it, since you also get Jeremy's thoughts about the TW structure. It helped me, to know "why" things are as they are.

-m
Reply all
Reply to author
Forward
0 new messages