How to edit a plugin?

Dear friends,
please excuse the silly question: how can you edit a plugin’s code?
When editing a plugin all I get is a list of tiddlers. How can you access the full code in order to search/find, make changes etc.

Thanks in advance
sklpns

See the Gatha Plugin (which is highly recommended, but which I haven’t used myself) and How to create plugins in the browser.

If you’re looking only to override the plugin files for your own wiki, the contents tab on the plugin will give you a list of all the files it contains. If you open one of them for edit, it will warn you about it being a shadow tiddler, but will let you change it.

I do my plugin development in Node, and I use that technique; then when I’m happy with the changes, I simply copy the edited tiddlers back into the plugin’s directory.

1 Like

Tinka is also worth recommending. It’s much simpler than Gatha, which of course comes with both advantages and disadvantages. I like it more for occasional small edits or creation of simple plugins.

Simplifying: a plugin is a single tiddler, which contains a JSON store of its subtiddlers, that’s all code there is. You see a list of these in the contents tab. Wiki behaves as if these were normal tiddlers, but they are actually contained in the single plugin tiddler.

If you edit any of those, a shadow tiddler is created, overriding the version from the plugin.
You can test your modifications at this point.
You can delete the shadow tiddler, to revert to the plugin’s version.
Note that if you edit any JavaScript, the wiki will need a reload before the changes are reflected.

If you want your changes to be integrated in the plugin, the actual plugin tiddler and the subtiddlers inside the JSON store have to be changed. This is easiest to do using a dedicated plugin-editing tool, like the aforementioned Tinka or Gatha.

3 Likes

Thank you both very much, will try your suggestions and get back to you. Thanks!

It is possible to edit tiddlers in a plugin,

  • access them as shadow tiddlers eg in the plugins contents tab, or from a list including [all[shadows+tiddlers]..
  • But this way you can search the tiddlers in the plugin as well
    • In some cases you may want to use the plugintiddlers Operator
    • Or use a subtiddler attribute available on some widgets.
  • See also the shadowsource Operator

However they are just JSON representations of tiddlers in the original plugin tiddler.

You may consider changing or deleting the type or plugin-type fields for different actions on a tiddler.

never said thanks, my bad! Thanks!

Search the plugin on CPL, hopefully uploader will fill-in the Github URL. For example https://tw-cpl.netlify.app/#Plugin_202403161108223

And edit it on Github, send a PR. Or fork it and reupload to CPL.