tiddlyhost / tiddlyhost-com

Rails application for creating and hosting TiddlyWiki sites, plus resources for deploying it to https://tiddlyhost.com/
Other
188 stars 18 forks source link

Support injecting a shadow tiddlers for json store TiddlyWiki #341

Open simonbaird opened 3 months ago

simonbaird commented 3 months ago

From https://github.com/TiddlyWiki/TiddlyWiki5/pull/8441#issuecomment-2268752193 :+1:

In TiddlyWiki Classic shadow tiddlers were stored in a single hashmap. In TiddlyWiki 5 shadows are automatically created at startup from the tiddlers within the loaded plugins.

So, the approach for TW5 would be to pack your tiddlers into a plugin, and then inject that. You'd be injecting a single tiddler with the usual plugin fields, with its content being a JSON hashmap of the constituent tiddlers.

The info mechanism in the core works similarly by dynamically creating a plugin at startup on the browser side. It uses the title $:/temp/info-plugin for the plugin. It may make sense for you to use $:/temp/tiddlyhost if you wanted to avoid the plugin being saved back to the server.

I think it would be nice to use a shadow tiddler for $:/SitePreviewImageUrl.