Custom changers
Hello,
Recently, while trying to add transitions to inline hooks, I found myself wanting a way to generate something along the lines of (link-reveal: _link)[(transition: "fade")[content]]
. I've been trying to find a way to do this using the new custom macros functionality to no avail. I realized this would be possible if there were a way to make our own custom changer macros that could take in hooks as part of their arguments.
Another use case there would be for this is also related to links, doing something such as the snippet below and turned into a single macro could help greatly.
(set: $speak to (macro: string-type _track, [
(out:)[{
(link-reveal: "`[...]`")[
($hal_play: _track)
(set: $_track to _track)
(event: when not ($hal_isPlaying: _track))[
(show: (hooks-named: $_track))
(move: $_track into __track)]]}]]))
Right now, this macro works by using a hidden hook that has the same name of the first argument, making the usage look like ($speak: "track")|track)[=
. It feels quite hacky and doesn't quite work in all use cases.
The solution could take many forms. Either adding a descriptor
keyword that is available inside calls to (macro:)
, or by adding a hook
datatype. I think either solution would be fine, and it depends more on the internal workings of custom macros.
I hope this can be considered at some point, thanks!