Can ordinary tiddlers be made into shadow tiddlers?

148 views
Skip to first unread message

Anjar

unread,
May 9, 2021, 7:28:15 AM5/9/21
to TiddlyWiki
Hi!

Shadow tiddlers have some nice properties, s I wonder: can ordinary tiddlers be made into shadow tiddlers or is it technically difficult? So that if a new tiddler is created with the same title, the old one disappears but is lurking in the background as a shadow?

Best,
Anders

PMario

unread,
May 9, 2021, 12:49:04 PM5/9/21
to TiddlyWiki
On Sunday, May 9, 2021 at 1:28:15 PM UTC+2 Anjar wrote:

Shadow tiddlers have some nice properties, s I wonder: can ordinary tiddlers be made into shadow tiddlers or is it technically difficult? So that if a new tiddler is created with the same title, the old one disappears but is lurking in the background as a shadow?

As soon, as a tiddler is part of a plugin, it will be a shadow tiddler. So yes. Every tiddler can become a shadow if you publish them as a plugin.

... Shadows can be edited, so they become "ordinary" tiddlers. ... There are 2 types of ordinary tiddlers.

"system" and "standard" tiddlers... System tiddlers start with $:/ ... which is "just a convention"

If a tiddler has an "overwritten" shadow, there will be some info in the EditTemplate. And there is the $:/ControlPanel : Info : Basics : Number of overridden shadow tiddlers  info. This is the filter it uses:  [is[tiddler]is[shadow]sort[title]]

If an overwritten shadow is deleted, the shadow will take over again. ... That's basically what you named: "nice properties"

-mario

Mark S.

unread,
May 9, 2021, 1:12:59 PM5/9/21
to TiddlyWiki
Tinka is a tool for making tiddlers into a plugin. You could also use it to add tiddlers to an existing "storage" plugin.

TW Tones

unread,
May 9, 2021, 9:33:19 PM5/9/21
to TiddlyWiki
Anjar,

Shadow tiddlers is quite a big subject since it relates to a large part of the core, plugins etc... 

I do personally believe there are many opportunities to make use of this infrastructure for much more, which I think you question hints at. I have done quite a lot of exploration in this space and will share but a little in this response.

Shadow tiddlers are known as tiddlers inside a plugin, but a plugin is only a tiddler containing one or more tiddlers defined in JSON. This allows more than one tiddler to be packaged in another tiddler. Accessing such embedded tiddlers is via the shadow tiddler model.

There is already code to support converting tiddlers to JSON, and it is the import process. After dropping a set of tiddlers on a wiki (any wiki), rename the $:/import tiddler before importing, (remove its existing fields). It is then a JSON tiddler. However to convert it so it allows access to the tiddlers within as shadows, you need to change it into a plugin. This is not complex as it the case with most things in TiddlyWiki.

Changing a JSON Tiddler of tiddlers into a plugin and related shadow tiddlers.
  • Edit the JSON tiddler and add or change the plugin-type field to have a value of plugin
You now have a plugin tiddlers, and you can find it in the list of plugins, bur it is not making use of all the features, it only has a contents tab.

You can now edit these to turn the shadows into real tiddlers, drag and drop between wikis and export it for import later.

Cool yes?
Tones

Anjar

unread,
May 14, 2021, 6:04:35 AM5/14/21
to TiddlyWiki
Thank you for the insights!
Reply all
Reply to author
Forward
0 new messages