You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m planning to create a new widget for my wiki that takes a template string and generates random output, similar in spirit to perchance.org.
Currently, I have a filter operator that returns a number of random results from a list, but using it for every placeholder—fetching JSON data repeatedly—feels tedious and error-prone. I want to streamline this for dynamic RPG campaign content, like:
In the tavern you meet <npc.name>, a <npc.profession> who offers you a <reward> for <task>.
or
The <dungeon.name> is a <dungeon.type> filled with <dungeon.hazard> and rumored to hold <dungeon.treasure>.
Each category (e.g., dungeon, npc) is stored in a separate JSON tiddler, like this:
I’m posting here rather than in the user forum because this is a technical question about widget design and TiddlyWiki internals, and I’d like feedback from the core developers.
My requirements:
I need to be able to reroll any placeholder individually, in case one doesn’t fit the theme I want.
I want to be able to store the result in a new tiddler if I like what I get (i.e. a save button).
My questions:
What would be a good syntax for placeholders in the template string, ensuring it doesn’t collide with existing syntax like transclusion and filters?
Is a custom widget the best approach, or is there a more efficient existing feature (e.g., macros, plugins)?
Are there any performance considerations I should keep in mind when fetching and processing JSON data in this way?
This would significantly simplify my RPG campaign prep by avoiding repetitive filter calls and making the content generation more maintainable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I’m planning to create a new widget for my wiki that takes a template string and generates random output, similar in spirit to perchance.org.
Currently, I have a filter operator that returns a number of random results from a list, but using it for every placeholder—fetching JSON data repeatedly—feels tedious and error-prone. I want to streamline this for dynamic RPG campaign content, like:
In the tavern you meet <npc.name>, a <npc.profession> who offers you a <reward> for <task>.or
The <dungeon.name> is a <dungeon.type> filled with <dungeon.hazard> and rumored to hold <dungeon.treasure>.Each category (e.g.,
dungeon,npc) is stored in a separate JSON tiddler, like this:I’m posting here rather than in the user forum because this is a technical question about widget design and TiddlyWiki internals, and I’d like feedback from the core developers.
My requirements:
My questions:
This would significantly simplify my RPG campaign prep by avoiding repetitive filter calls and making the content generation more maintainable.
Thanks for any advice or suggestions!
All reactions