Update Tinka to Show and Set Plugin Priority?

Hello All, I have found 2 plugins for ‘local development’ (local HTML vs node.js) development of tiddlywiki plugins within a TW itself, Gatha and Tinka.

Gatha is nice b/c it sorts out the dev environment from the plugin building itself, and can do literally everything include language stuff, but I also kind of find it clunky to use.

Gatha Studio Workspace 2.0.3 — develop plugin using Gatha and Gatha-Thirdflow on Node.JS

Tinka ( TinkaPlugin/Tinka: Tinka is an easy plugin packer for TiddlyWiki5.) I find to be much more elegant for UI and usability, though it’s philosophy is your dev environment contains your plugins as well. (this is fine for my use) The big thing it seems to be lacking is the ability to set or edit the plugin priority number, which Gatha has.

Tinka appears to be long since inactive so I’m curious how difficult would it be to modify the tinka plugin to expose the ‘plugin priority’ number field?

Just let me know, thanks!

-Xyvir

Oh parent-plugin would be a good field to have as well.

I think there may be a way to access and edit these fields via info sidepanel? Just let me know if there are existing workarounds im not aware of.

A third alternative for plugin creation: TiddlyTools/Search/SaveAs

This single-tiddler pure wikitext add-on (no javascript code!) adds “save as plugin” and “save as import” buttons to the $:/AdvancedSearch > Filter tab. You can use it to create a plugin containing the tiddlers from the search results and set all of the plugin-related fields:

  • author
  • core-version
  • dependents
  • description
  • list
  • name
  • parent-plugin
  • plugin-priority
  • source
  • stability
  • version

The output tiddler is a plugin that contains shadow tiddlers and can be directly installed into another TiddlyWiki using drag-and-drop.

Note that you can also use TiddlyTools/Search/SaveAs to merge the contents of multiple existing plugins into a single unified plugin, as well as create “themes” (which are actually a special type of plugin) and “importers” (non-shadow “bundles” of tiddlers that can also be imported into other TiddlyWikis using drag-and-drop).

enjoy,
-e

1 Like

Oh I’ll check that out for sure! I wasn’t aware of that one thanks.

Does plugin priority do anything for you ?

My recollection is that the priority field only gets applied after the plugins have been sorted by name alphabetically, which makes it only useful for the most trivial of cases. It’s also an incentive to give yourself a name like “aaaPluginDeveloper”.

But it’s been awhile, so maybe I’m remembering incorrectly.

My understanding is that conflicting (same named) shadow tiddlers are resolved first by plugin priority, and default to alphabetical plugin name as a fallback but I haven’t actually dug around in the code to verify that.

If someone more knowledgeable could accurately speak to the behavior I’d greatly appreciate it.

Of course Gatha is authored by @Mohammad and it is always worth mentioning the author so they see what you are talking about. I think @oeyoews may be the tinka author/

1 Like

Tinka is by Andreas Hahn, but I’m not sure he’s here on Talk TW; his last updates to Tinka predate the creation of this forum.

2 Likes

Here’s the prior conversation about link priorities:

After reading the thread, This might be an non-issue in my case as my patch plugins are named like:

$:/plugins/xyvir/foobar

And come alphabetically after the other authors’ plugins I want to patch.

So I guess I likely won’t have to fuss with plugin priority anyway, which is kinda neat.

Feels to me it is a relatively easy (and useful) add to Tinka:

  1. in the $:/plugins/ahahn/tinka/editMetadata tiddler , insert |Plugin priority:|<$edit-text tag="input" type="text" field="create-plugin-priority"/>|<|<| somewhere
  2. in the $:/plugins/ahahn/tinka/createMetadata/tableHead tiddler , insert somewhere :
		<td>Plugin priority:</td>
        <td><$edit-text tag="input" type="text" placeholder="1" field="create-plugin-priority"/></td>
	</tr>
  1. in the $:/plugins/ahahn/tinka/tinka-repackagePlugin.js tiddler , insert pluginTid["plugin-priority"] = diff.fields["create-plugin-priority"]; somewhere in the repackagePluginWidget.prototype.invokeAction function

then repackage Tinka itself (optional) and reload. Didn’t text extensively, but seems to be sufficient.

I haven’t got a chance to test it extensively either, but it seems to have worked mostly. But for some reason with your patches the plugin only seems to ‘save’ the priority values when entered from the ‘modify existing plugin’ option and packaged, but not the ‘create new plugin’ option. Which still packages the plugin correctly but when you save, reload and go back to ‘modify’ the newly packaged plugin the priority value you had entered on the creation screen isn’t there.

fixed a typo above in step 2 that probably explains it:

<$edit-text tag="input" type="text" placeholder="1" field="plugin-priority"/> instead of <$edit-text tag="input" type="text" placeholder="1" field="plugin-priority:"/> (note the extra erroneous colon).

1 Like

For $:/plugins/ahahn/tinka/createMetadata/tableHead I actually think you also need to have create- prefixes in the field= value as seen below:

	<tr>
		<td>''Plugin Path:''</td>
        <td colspan="3">`$:/plugins/`<$edit-text class="tinka-inline-edit" type="text" placeholder="e.g. myName" tag="input" field="create-title-org"/>`/`<$edit-text type="text" class="tinka-inline-edit" placeholder="e.g. myPlugin" tag="input" field="create-title-name" /></td> 
	</tr>
    
    <tr>
		<td>Author:</td>
        <td><$edit-text type="text" placeholder="e.g. John Doe" tag="input" field="create-author"/></td>
		
		<td>Source:</td>
        <td><$edit-text tag="input" type="text" placeholder="e.g. http://twguides.org" field="source"/></td>
	</tr>

	<tr>
		<td>Dependents:</td>
        <td><$edit-text tag="input" type="text" field="create-dependents"/></td>
        
        <td>List:</td>
        <td><$edit-text tag="input" type="text" placeholder="e.g. readme usage" field="create-list"/></td>
  	</tr>

    <tr>
		<td>Plugin-Priority:</td>
        <td><$edit-text tag="input" type="text" placeholder="1" field="create-plugin-priority"/></td>
		<td>Parent-Plugin:</td>
        <td><$edit-text tag="input" type="text" placeholder="$:/plugins/ahahn/tinka" field="create-parent-plugin"/></td>
	</tr>

Thanks for helping me notice that.

-Xyvir

right on! updated post above.

Thanks!

1 Like