I debug why an action widget will execute twice for a few hours (at night). Today when my brain is clearer, I look down the source code, and find an undocumented allowActionPropagation
method does the trick.
The example
<$button>
Click to receive <<count-gamification-reward>> rewards.
<$let experienceSaveFile="experience">
<$action-convert-game-event $eventTypes="SmallReward">
<$action-createtiddler
$basetitle=<<experienceSaveFile>>
$overwrite="yes"
text={{{ [<gameEvents>enlistJsonFilterTypeGetEvents[SmallReward]jsonget[amount]sum[]] =[<experienceSaveFile>get[text]else[0]] +[sum[]] }}}
/>
</$action-convert-game-event>
</$let>
</$button>
The action-createtiddler
triggered twice, because button triggers it if I’m not using an undocumented allowActionPropagation
method. And my custom widget $action-convert-game-event
trigger it again.
So we really need a guide and full API doc for plugin developers. I think the https://tiddlywiki.com/dev/ is not enough, because it is manually maintained, is getting out of date because it doesn’t matter. We might need an auto-generated doc from the source code, that will block development if it doesn’t get updated, so people will going to update it.
And it is impossible to put all API to https://tiddlywiki.com/dev/ .