You're really asking two different questions. Maybe even 3.

A plugin is just a packaged bundle of tiddlers. It's not too hard to make 
with node. Make a directory "plugins/myplugin" below your node-based TW 
folder and then put whatever tiddlers you want in myplugin. Add a file 
"plugin.info" (see tiddlywiki for details how to populate plugin.info) and 
run node.js. Navigate to plugins and you'll see your new plugin. You can 
export if from there if you want.

A button that invokes javascript would need a widget or a javascript macro. 
The easiest way to make a javascript macro is to look at an existing one 
(e.g. $:/core/modules/macros/now.js) and modify it accordingly.

For starting things during boot, type "startup" into tiddlywiki.com for 
information on how to set up tiddlers that get invoked at startup. However 
it's possible that what you really want is $:/tags/RawMarkup . Be aware 
that if you put JS code into RawMarkup inside a plugin that you will have 
to save and reload your TW file twice.

But you may actually want help with writing widgets. If you find any 
simple, understandable guide to writing widgets please let me know! Chris 
Hunt (?) had a guide, but now you have to find it on the internet archive, 
and the code he uses doesn't match the current code, which is confusing.

On Wednesday, March 10, 2021 at 1:45:50 PM UTC-8 SimonBaird wrote:

> https://tiddlywiki.com/#PluginMechanism talks about plugins and how they 
> work etc, but how do I make one?
>
> Suppose I wanted to run alert("Hello") when TiddlyWiki starts up, or 
> create a macro that creates a button that runs alert("Hello World").
>
> Where do I begin?
>
>
> -Simon
>
> -- 
> [email protected]
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/383f107f-92db-4b9a-97af-7a7e6700b794n%40googlegroups.com.

Reply via email to