Gatha Plugin: Beta Release - Create and Distribute Tiddlywiki Plugins

Related   

I use it all over the place…

@saqimtiaz, @Mark_S , @CodaCoder
I decided to hide the load plugin button by default! User can change Gatha setting to show it!
I myself rarely need it!
I am thinking to add repackaged field with some explanation! while modifier can simply delete this after repacking!

This is the issue in Tinka, ThirdFlow and other tools out there! I mean there is no secure method to make a repackaged plugin distinguishable.

Screenshot 2022-02-16 163032

TT

2 Likes

For Mark’s particular workflow, you might also want to add a button which adds the relevant tiddlers to the story.

  1. cache the default tiddlers

  2. set default tiddlers to the workspace tiddlers

  3. reset to “home”

  4. restore the previous default tiddlers

That is a workspace manager I use a lot. I call it Arranger here, but that’s the bare bones of it.

Code dump:

\define view-story-btn()
<!-- The "Apply" button... -->
<$button class="tc-btn-invisible tc-tag-label rgt-arranger-label" tooltip="Apply this story to Tiddlywiki">
  <$action-sendmessage $message="tm-close-all-tiddlers" />
  <$action-setfield $tiddler="$:/.rgt/arranger/arranger-res" $field="cached" $value={{$:/DefaultTiddlers!!text}} />
  <$action-setfield $tiddler="$:/DefaultTiddlers" $field="text" $value={{$:/.rgt/arranger/arranger-res!!list}} />
  <$action-sendmessage $message="tm-home" />
  <$action-setfield $tiddler="$:/DefaultTiddlers" $field="text" $value={{$:/.rgt/arranger/arranger-res!!cached}} />
  <$action-setfield $tiddler="temp" $field="text" $value={{$:/.rgt/arranger/arranger-res!!cached}} />
 <span style="font-size:120%">Apply</span></$button>
\end
1 Like

I think that is par for the course in TW. It is not so serious an issue. In fact it is a kind of freedom. But we, well you, not me :slight_smile:! , (specifically developers) do need an awareness of issues that less free systems enforce that TW leaves open.

I hope this is clear!
TT

1 Like

I think that would be sufficient, the remark could even just be the date. The goal isn’t to guard against someone trying to do something malicious, rather against the situation where someone modifies a plugin and forgets to change the name or mark it as modified in some other manner.

2 Likes

In Gatha v0.9.5 there are two new features

  • plugins created/loaded on export have a packaged-by field like: "packaged-by": Gatha on 17th February 2022, 20:11:42

  • an optional section Resource tiddlers is added to act as a folder to keep note, doc, test, example tiddlers

2 Likes

Gatha is now called: Gatha Studio Workspace.
Special thanks to @CodaCoder

Image updated after @CodaCoder hint!

2 Likes

I know you liked my name, Mo, but you don’t need to use it twice :rofl:

image

1 Like

Release 0.9.5

  • Feb 17th, 2022
  • [NEW] field packaged-by as a time stamp added to plugin.info and plugin tiddler to distinguish the exported plugin is packaged or repackaged by Gatha
  • [NEW] resource tiddlers section is added to list related doc, note and example tiddlers. resource tiddlers are not packaged or exported as plugin by default
  • [NEW] resource tiddlers are exported to backup source file
  • [FIXED] plugin.info generation updated to use a central macro

Code and demo

2 Likes

You could add even more convenience with a button similar to plugin demo (demo.html), except instead of downloading the demo.html, this button would launch a tiddler containing an innerwiki widget using demo.html as the template.

<$innerwiki template="$:/plugins/tiddlywiki/innerwiki/template"/>

That way you can see the resulting tiddlywiki with a single click of the button and quickly iterate many times.

But that button would only be useful if the innerwiki plugin is loaded.

Looks like with the $:/tags/Gatha/ExportButton tag, it would be easy for anyone to implement this button I’m proposing.

1 Like

I played with this a little and maybe a custom template is not the right way and instead a tiddler for the plugin should be passed in using the data widget. I just tested in a hand-crafted tiddler like this:

<$let currentTiddler="$:/plugins/btheado/test-with-gatha">

<$innerwiki>

<$data
  $tiddler=<<currentTiddler>>
  type="application/json"
  plugin-type="plugin"
  text={{$:/plugins/kookma/gatha/export/json-template}}/>

<!-- for convenience automatically open the plugins tab
 (need to embed in another tiddler since with the latest 5.2.1 TW,
 it doesn't get rendered otherwise) -->
<$data title="plugins" text="{{$:/core/ui/ControlPanel/Plugins}}"/>
<$data title="$:/DefaultTiddlers" text="plugins"/>

</$innerwiki>

</$let>

The contents of the plugin are empty, so maybe {{$:/plugins/kookma/gatha/export/json-template}} is not the right thing to use. But this might be on the right track.

This does not create the text part, instead it creates the whole tiddler. That is why it does not work this way! I think the above snippet needs macros to create the tiddler in place!

Hi Mohammad, when I was looking for the config options, I looked at the plugin first – I think it wouldn’t be much work to add a configuration tab there? (This would also be a solution for people who disabled Gatha settings in the more sidebar to re-enable it.)

Hi Thomas, I follow the Tiddlywiki standard!
Settings tab is under $:/ControlPanel! but users can customize it!

So, you may like add $:/tags/SideBar to have it on the sidebar or a button close to Load Plugin!

I prefer to keep the UI minimal. That is why by default I made load plugin, add bulk tiddlers, and Recourse tiddlers hidden!

1 Like

There is a ticket on GitHub to expand and make Settings tab more flexible.

What you can optimise is the display of the chosen option according to vanilla standard like this:

grafik

by putting this in your stylesheet:

.ga-sidebar .tc-drop-down button:hover {
	color: <<colour tiddler-link-background>>;
	background-color: <<colour tiddler-link-foreground>>;
}

If you think of the select options – they are styled by the browser, not via CSS.
(See <select>: The HTML Select element - HTML: HyperText Markup Language | MDN)

1 Like

Much appreciated. Works like a charm.