Rerun macro
See original GitHub issueIs your feature request related to a problem?
Instead of <<replace>>
+ <<include>>
or <<replace>>
+ rewriting the original content, a macro that lets you “re-run”/re-wikify a target HTML element, similar to Harlowe’s (rerun:)
macro makes a lot of sense.
Not sure about the name <<rerun>>
. I feel like <<update>>
makes more sense, but Harlowe already named the feature, so I think it’s best to stick to that.
Describe the solution you’d like.
@@#target;$cash@@
<<link "Spend money">>
<<set $cash -= 10>>
<<rerun "#target">>
<</link>>
Describe alternatives you’ve considered. Just a convenience option. Replacing via DOM macros is simple enough for the same effect but always requires a bit of rewriting that could be easily eliminated for such a common construction.
Additional context. I plan to add this to my macro collection, but I actually think it would make sense as a standard library macro, so I figured I’d ask about it here first.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (10 by maintainers)
As the commit message notes, it’s in.
The documentation feels like a train wreck though. For example, the description of tags for both macros are awkward. 🫤
PS: The docs can finally be built using only NPM packages. No need for an external binary now.
The longer I mull it over, the more I sour on
<<redo>>
due to the undo/redo angle. I do think I’ll switch to<<refresh>>
for the update macro.