This may be discussed elsewhere, but I cannot find the discussion.
There are requests to do some actions on tiddler save like:
-
convert a field value like date field to TW date format, e.g user enters
2022-08-25
and on save it needs to be converted into20220825120000000
. This is true if browser calendar widget is used -
In tiddler text user enters
#Task
,#Proposal
, … and on tiddler save they need to be converted into tags and added to tiddler tags field (there is a plugin for this, see links.tiddlywiki.org)
In summary one needs automate some actions and these can be done by TW on tiddler save.
Implementation
to allow average users do such actions without touching core tiddlers or need for using JS, Tiddlywiki can use modular actions (transcluded actions)
- TW can have a new tag like
$:/tags/TiddlerSave/Actions
- One adds as many actions as required, all tagged with
$:/tags/TiddlerSave/Actions
- Save button actions in ($:/core/ui/Buttons/save) then will be revised as below to include such actions on tiddler save
<$fieldmangler><$button actions='
<$list filter="[all[tiddlers+shadows]tag[$:/tags/TiddlerSave/Actions]!has[draft.of]">
<$transclude />
</$list>
'
..