How to Simply Hack a Plugin and Repack it

Assume, you want to hack (modify few shadow tiddlers in a plugin) and repack it, for example you want to add an attribute to dynamics table in Shiraz.

Modify the plugin

  • Open Shiraz plugin from $:/ControlPanel
  • Click on the Contents tab on Shiraz plugin tiddler just opened ($:/plugins/kookma/shiraz), and then select the shadow tiddlers you want to hack
  • Edit the shadow tiddlers and save

Repack it

  • Open the Browser Consol from your opened TiddlyWiki window (the browser tab you have your TiddlyWiki opened)

    • Most browsers support F12 to open developer window (and the select console tab)
  • Enter the below command into the Consol and run it (by hit ctrl+enter, or click on Run button, or enter depend to your browser)

    $tw.utils.repackPlugin("$:/plugins/kookma/shiraz")

More details can be found here: How to create plugins in the browser

Tip: When you modify a shadow tiddler, a copy will be created in your TiddlyWiki. No need to repack the plugin! The repack is useful when you want to reuse the hacked plugin across several others TiddlyWiki.

Important Note:

  • Read the plugin License before hacking it.
  • Always add a note to repacked plugin, or rename it (when you put it in a public domain)
  • Do not redistribute the hacked plugin except you have clearly added a notice to differentiate it from original plugin
14 Likes

Been wondering how easy this could be. Thank you I will have to try it.

I sometimes hack and repack plugins. Change/create a readme tab with a notice to myself that is not the original. Generally do not publish and frequently have to redo the hacks for new releases, so document in the readme what I changed.

Maybe could use the plugin ‘stability’ field -something like STABILITY_4_CUSTOM. What you think?

One issue is that unknown stability levels are not displayed by the core and so we would need to add support in the form of translation strings and custom palette colours.

I think the most important advice for modifying a plugin is to rename it to a unique name so that there is no possibility of anyone mistaking it for the original plugin.

1 Like

I highly support Jeremy’s idea.
Especially if you want to redistribute the plugin.

1 Like

Mind Blown, I’ve been using tinka for this, never knew repacking was a baked in thing!

I would like to see this made available as an action in the interactive wiki. Not for regular code plugins but for data plugins. Import a data plugin, make changes as one proceeds, allow additional tiddlers to be added, then repack the plugin and export.

  • While that plugin resides in the current wiki it can accumulate changes and be exported and distributed to other wiki’s.
  • If we could generate a plugin library for these data tiddlers other tiddlers can see when the data tiddler has being updated to update it locally.

An example may be a list of contacts, tips for tiddlers etc…