"Programming" tiddlywiki

How did those of you creating plugins and customizations of TW learn how to do it?

I haven’t created any packaged plug ins yet, but have done tons of customisations in my wiki.

From my experience, the best way is to study the already existing plug ins (from Dave Gifford’s collection in dynalist or links-tiddlywiki or from this forum), core macros and procedures, solved posts in this forum or even the demo /showcase wiki seen in this forum and learn how they are created by reading the main macro tiddlers of those. Read from the documentation in https://tiddlywiki.com/# if you see any new filter operators or widgets within those macros or procedures.

2 Likes

It is a gradual process; I can assure you that even a beginner can both “create plugins” and do “customizations” at a very early stage; A customization is of course merely any change, perhaps even switching palette (because this creates a value in a so called state tiddler) and “create a plugin” can be done by using some plugin packer to package any tiddlers.

For a plugin packer I’ve (only) used Tinka for several years, and I’m not a coder. Here’s an old presentation about it. I also believe @Mohammad has created a plugin packer, and there may be more.

…come to think of it, I (still!) don’t know how the really big boys here make TW plugins? @pmario , @EricShulman , @saqimtiaz (to name just three of the most prolific ones that are also real coders) - how do you create your plugins?

2 Likes

I would start by finding an existing simple plugin that you wish to use or find interesting and learn how to make a few simple changes to the way it behaves, it might be best to download a TW for experimentation only so that you do not need to care much if you make mistakes - indeed keep a “master copy” and an experimental copy so that you don’t need to repeat downloads. I think a fear free environment to play around is the best way to start - if you mess up just create a new working directory - copy your master files into it and start again.

Once you have downloaded and installed a plugin you wish to use the “More” tab of the tool bar to find the plugin and then by clicking on the plugin itself you should be able to find your way to seeing what it actually contains in terms of source files.

Here is a simple plugin I used to add “up” and “down” arrows to the tool bar of every tiddler so that you can move it up and down relative to other tiddlers in the story river. It contains only 3 files and two of those are icon images. I am sure there are better ways to code this but my reason for selecting it is it’s simplicity.

I don’t know what others would advise but if you are working in a text TW that you are happy to throw away then I would say ignore warnings for now about editing tiddlers and simply play around making changes and seeing what happens. Later on you could find out how to package the tiddlers into a finished plugin that you could share with others.

$__plugins_jonnie45_TiddlerMoveUpDown.json (3.8 KB)

2 Likes

As with anything, I recommend starting with scratching an itch. Want to change something’s width? Hide a part of your wiki? Style the story differently? This is a great way to learn and to stay motivated.

For playing with making your own plugins, I’ve had good success with @Christian_Byron’s “Phack”.

ultimately a plugin is just away to package some tiddlers. if you know what you want to package there are a number of ways to do it, a bundle, a json file of tiddlers, a plugin and via a package tool. I often use bookmarklet’s.

perhaps share what you have or want to do for some support, if it’s just for an experience then try and find something that people want.

most solutions can be achieved without JavaScript only tiddlywiki script, so it’s worth working that out before. perhaps start with tiddlers that follow the naming standards.

https://tiddlywiki.com/dev

Step through the TW code in the dev tools debugger. Grep for code in the sources tab in dev tools. Looking at similar plugins’ code.

i think one of the first things i learned to do was make a custom keyboard shortcut. it showed me how action-widgets, system tags, and fields work and i could build up from there to make more complex changes.

Oh, Let me add most of the parsers, filter operators etc…, have system tiddlers ending .js I have had some success as a script kiddy cloning these and making changes or even rewriting in full (including with LLM support) to make “new extensions” to tiddlywiki. Also extending the functionality of an existing plugin.