I would like to create a macro (I’m using an older wiki) that would repeat a value based on the number defined by the parameter. I envision something like this:
\define rating(num): Where “*” is returned the number of times specified in “num,” for example:
You’ll notice that both macro and procedure need a text widget to display the plain-text output of the filter. However, if you’re using 5.3.0+, we can do this even more simply with a function, also called with the same <<rating 3>>-type syntax:
Although this doesn’t work on my file for some unknown reason, I tested it on the most recent Tiddlywiki version and all three work like a charm.
My TiddlyWiki version is 5.1.23, which doesn’t seem terribly old, but perhaps that is the problem? I get the following error:
“Filter Error: Unknown prefix for filter run”
If anyone knows the cause/fix for this, please let me know. But, the problem is obviously not in the syntax that etardiff provided since that works splendidly.
I may have to just give up pursuing this for this particular file.
Oh, you’re missing the :map filter run prefix; it was introduced in 5.2.0. v5.1.23 is quite old (released in December 2020); you’ll be missing a number of useful filter operators in addition to 5.3.0+ features like procedures and functions (and a lot of other non-filter goodies).
I’d recommend upgrading just for access to things like :map, even if you never need most of the other newer features! I think the vast majority of active members here are using at least 5.2.0+, and that will color any suggestions you receive.