I’ve recently had a need to embed some reasonably complicated JavaScript calculations into a TW, along with a nice form to fill in parameters.
No problem, the form is in one tiddler and the JS in another. Now I have two tiddlers!
Then I wanted to “hide” the JS, or at least make it less obvious, so I added “$:/” to the title.
The problem now is that it is not obvious that the two tiddlers are a matched pair and should always be together.
Is there some way to embed JavaScript into a tiddler, or some way to associate the JS tiddler with the form tiddler so if the form tiddler is dragged to a new wiki, the JS goes with it?
I got excited when I read about CompoundTiddlers in the latest 5.3.4, but was ultimately disappointed.
It seems if I really want to keep the two together my only option is to make a plugin with the JS and a macro to generate the form, then require people to add the plugin, create a “host” tiddler for the form and call the macro in that to generate it.
Is there anything I’ve missed?