a package of tiddlers in one wiki which you can see in an iframe, you can drag from the iframed wiki to the current one to install
My recently mentioned use of bookmarklets.
The issue about “injecting” is you can do it by editing the html file, perhaps even easier now the tiddlers are stored in JSON, however if someone has the wiki open they may not see the file update and save back over it without keeping the injected tiddlers.
One approach I considered was use autosave on the wiki, then once saved start a timer eg 30seconds. Once the 30seconds has passed make the wiki read only so to use it you must reload from disk, and thus catch the tiddlers injected by another process. Or some version there of.
Another may be only inject tiddlers at midnight, and save and lock the wiki from saving at midnight, forcing a reload before use.
There are a subset of cases where just loading the “scheduled for injection tiddlers” at open of the wiki for interactive use is feasible, like you are importing content over time and no one else needs to see the “scheduled for injection tiddlers” until the owner opens it interactivly and imports them.
This method would benefit from code that detects and input JSON exists and imports its tiddler.
This allows the owner to curate injected tiddlers, but is otherwise automated.
It would be great if we could get a way to message a running wiki to tell it what to do if someone is currently using it interactively. Eg Save a logout, or load tiddlers etc…
Consider having a published wiki which is only ever updated programmatically, through injection and perhaps a seperate wiki, from which you generate content that updates the published wiki via injection. Then you are never at risk of overwriting injected content.
All you want is the visitors to the published site to reload occasionally eg daily/hourly etc… and this can be automated.
Then I personally would get my analyses to store the updates somewhere, open my wiki and import. Using KISS principal. Make it easier with some of my above ideas but don’t bother injecting, just import.
In your wiki use [[download changes|file:///I:/TW5%20Intranet/!Working/check-stamp-field.json]] in a tiddler, now when you open a wiki this tiddler opens and do a r-click save as on the above link and save it in a scratch folder, a temporary folder you regularly delete the content of.
Now in chrome the filename is listed at the bottom of the browser, drag and drop it on your wiki, to get the content.
In fire fox its the same but you open the download menu and drag it from there.
Why the need to inject? Is this a situation where we don’t have access to Node?
If I were to think about including generated data inside my TiddlyWiki I would approach it from a programming perspective. In fact I did just that in my Personal Blog site.
In that example I wanted to embed diagrams into my blog posts. To accomplish this I used a compiler called PlantUML. I used a Makefile that understood how to build any diagrams/*.uml file into an SVG in my tiddlers/generated/ folder along with a *.meta file to add a title and type field for the resulting tiddler.
Then when I ran Make it would build any out-of-date diagrams to the generated folder and then the TiddlyWiki build system would compile a single HTML output which I could copy to any medium I wished.
If you want to directly modify the TiddlyWiki html file, the recommended approach is to add an extra script tag at the beginning of the file, though this cannot overwrite existing tiddlers. See the section called “Multiple store areas and precedence” at the very end of this tiddler: https://tiddlywiki.com/dev/#Data%20Storage%20in%20Single%20File%20TiddlyWiki
The other approach to consider is to use node.js to load the extra tiddlers into the single file wiki and save it again. You would need to use the tiddlywiki on node.js commands load, import and render: