Minimal bundler: holding tiddlers not a live part of current wiki

How do I offer a handle to drag to another wiki a collection of tiddlers that are not a live part of my current wiki?

I’ve certainly seen—and been impressed by—@pmario’s Bundler Plugin. I might well end up using it. But my needs are somewhat different, and I’m wondering if anyone can suggest an appropriate mechanism.

To document some TW ideas, I want to have a central documentation wiki, as well as a collection of example wikis. For demos, instead of what TW does—using its own page as the playground—I want to point to the example wikis, offering the user something to drag to a particular example wiki. That something should contain one or more tiddlers that will be imported into the example wiki. But I don’t want those tiddlers themselves to be part of the central wiki. I would assume that would mean that they are stored in JSON, but I’m not quite sure how it would work.

I imagine some macro/function/procedure that I can call like:

<<example wiki:books export:"$:/path/to/example/42" >>

which would user this:

caption: Author view template
tags: Share
title: $:/path/to/example/42
type: application/json

[{"title":"templates/Author", "tags": "$:/tags/ViewTemplate","text":"Some content here"},{"more":"here"}]

to offer a draggable source (using an icon or the caption/title text) that provides an import of the tiddlers from that JSON into the “books” example wiki (or whichever wiki you dragged it onto, although caveat emptor if it’s not the expected target wiki.)

If absolutely necessary, I could add some feature to the examples wikis to make this process easier, but I’d rather not; it would be useful if users could drag the examples to whatever wiki they like and then modify to suit.

So… any suggestions?


The original concept had these example wikis as subwikis or in iframes. I’ve come to think that those won’t work. But if someone could prove me wrong, I’d be ecstatic!

IMO – The easiest way will be to use tags. Since you can drag and drop import entire tag-pills from 1 wiki to an other one.

I’m not sure what you mean by this. Do you mean that you don’t them to be “live”, or active within the Central Wiki? But they can be stored there, right?

Yes, exactly. For instance, I do not want templates/Author to be active in the main wiki. It’s a ViewTemplate that I don’t need in there. But to be able to drag it from the main wiki, it must be somehow contained there. I assume that would likely involve using the JSON version, but maybe there’s something else.

Well, see my answer to Mark. The goal is to have these hosted somehow in the main wiki, available to be dragged, but not to be tiddlers of the main wiki in their own right.

1 Like

There is a new experimental “testcase” widget as a “draft pull request” at GitHub. You could play with that one and give feedback. May be it could end up in the next release if you are fast.

Not sure if that fits your needs.


Just brainstorming. – I was thinking about a mechanism, to bundle “theme”-like plugins, that can then be activated in a sequence.

Since a wiki can contain several theme plugins, where only 1 of them is active at one time, it will already be possible to use themes, to switch between different wiki states. – So 1 state could be 1 example.

So it should work already, if you know, how to create themes that rely on each other. It should be relatively straight forward using the VSCode dev environment.

But

There is no convenient way at the moment to do it within TW.

At some point, if the user needs to interact with the examples, they have to be tiddlers. If they are coming from plugins, they will be shadows.

As I wrote. Have a look at the “testcase”-widget, it is a stripped down version of the inner-wiki plugin

I am confident there are a few ways to do something similar. Certainly you can iframe Any wiki and drag and drop between them but with that you still have to load the whole wiki in the iframe.

  • if you export some tiddlers to a json file and it is available at a location the current site has access to it should be able to work.

I belive the best approach in the long run many be if we democratise access to generating libraries and add a drag and drop feature. Ie provide a tool to generate libraries from inside the wiki, not at the command line, perhaps creating a zip of files you can host online.

I will have more of a look today.

  • Do you want this public or only inside your local wikis?
  • why dont you want the tiddlers in the current wiki?
    • to save space
    • to have one source of truth
    • so they tiddlers are not active on the current wiki

I do not know if the Gatha-plugin can create themes atm. It may be a possibility to test with

If your putative users are patient enough to click the import button twice then there’s one weird trick.

Export your files to a JSON. Then import them back BUT don’t complete the import. On the $:/import tiddler, change it’s name to whatever new title you want.

Now you can create a link to this import tiddler and drag and drop it into a target TW. At the target the users will have to import TWICE. First to import the import. Then click on the link to the import and repeat to import the actual payload.

1 Like

I saw that with Jeremy’s geospatial work, but didn’t look at it closely. I’ll check again.

That’s an interesting model. I’ve not played at all with themes—other than importing them. I will definitely check this out.

That’s a bummer, but not a show-stopper for me. I do plenty of TW work from the command line or editor.

When I drag them to the example wiki, they definitely have to be tiddlers or shadows. But in my example above, the tiddler templates/Author should not show up in the main wiki, not available to search, definitely not a ViewTemplate in its own right. In one sense, it would be like having an entirely independent tiddlers store, inaccessible except to this drag mechanism. I doubt that would be the implementation, but it would act that way.

I will. Thank you.

While I’m not thrilled with that approach, I will try it out if I can’t find other things that will work. I might need to find an easy way to refresh the iframed wiki from the root one.

This will definitely be served in a way that this is possible, but I don’t follow how that would work. Could I offer from the main wiki a way to drag an external file to one of my example wikis?

That may be true. From my perspective the need to work from the command line would not bother me much or slow me down much, not at first anyway. But I’m hoping to make this community editable, and that would start requiring people adding to it to at least be comfortable with GitHub pull requests. I’d rather avoid that. Then this might be important.

:white_check_mark: so the tiddlers are not active on the current wiki

The example in the OP is a ViewTemplate. I would want to be able to drag that to a wiki where that ViewTemplate is useful. But I would not want its output appearing on tiddlers in my main wiki. In general, I would not want to clutter up the UI of the main wiki with anything designed only for an example.

I’d forgotten about that. I work in Node, mostly, so creating plugins is almost trivial. But this might help, or at least might show me techniques I could adapt. Again, thanks.

Wow, I never thought about that! It’s at the very least a useful backup plan. Thank you.

Perhaps this is the easiest approach;

One trick I use in a wiki full of plugins is to import the plugin then disable it. As a disabled plugin the shadow tiddlers are not present, however if you drag and drop the plugin tiddler to another wiki the plugin is installed and no longer disabled.

  • users could also enable the plugin in the current wiki if desired.
  • I will see if I can do this, I thought I had in the past.

I think the best example of this is what @Mark_S was suggesting.

I can give a more detailed explanation if needed, however you can store number of tiddlers inside a JSON tiddler, without them being viewed as separate tiddlers.

Actually it can be trivial in single file wikis as well, just ask if needed.

Yes, another useful option. The downside is that the tiddlers are then shadows in the child wiki, which is not ideal. But it’s an interesting possibility.

I can easily store many tiddlers in JSON in my wiki. But my drag then offered to import only the wrapper file and not the individual tiddlers. It was when that failed that I asked the question. Mark’s solution—which I’m about to try— offers a decent solution to this. I’d love something more than “decent”. though, if we can figure this out.

Thanks. I’ve seen various threads discussing it, some from you. I’m sure I can find them if need be. Doing this might become a necessity for opening up editing to the wider community, but it’s not high on my priority list at the moment… unless that does turn out to be the best way to solve this problem.

I had a way to go past this this I will review and let you know.

1 Like

Ok. Make your tiddlers into a plugin. Disable the plugin.

In your source, create a dropzone like this:

<$draggable filter="[[SpecialPlugin]plugintiddlers[]]" >Drag Us</$draggable>

Replace SpecialPlugin with the name of your plugin. Use this as your drag point. When you drag and drop into the target, the tiddlers will be imported as individual tiddlers.

4 Likes

Oh, that is sheer brilliance! Thank you very much. This is exactly the sort of solution I was hoping was available, but couldn’t come up with on my own.

Thank you for your help.

And thank you too, @pmario and @TW_Tones. There are a whole lot of great ideas in this thread, and I expect to pursue several of them for my own learning.

1 Like

@Scott_Sauyet (@Mark_S )

Ingenious, indeed. Now you (we) need a name for…

  1. These tiddlers

  2. This pattern.

Regarding #1, they’re not tiddlers in the everyday sense, they’re json structures with tiddler potential. What’s a good name for that?

Perhaps “tiddlings”?

The core refers to the tiddlers within the JSON body of a plugin tiddler as “subtiddlers”.

Keep that for some interesting package :nerd_face: perhaps an alternate to child tiddlers?

Sure, but that’s pretty boring. There’s sure to be a more amusing name. :wink:

1 Like

At a stretch, kinda, they’re proto-tiddlers.

PROTONS?