Using sha256 to add suffix

In a macro I want to use something like <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state"> to define a state tiddler but instead of using $n$, use a sha256 of another parameter of the macro, named src. What is the right syntax?

Try this:

<$let .state={{{ [<.state-prefix>] [{!!title}] [[/]] [<__src__>sha256[]] +[join[]] }}}>

Notes:

  • Instead of using a $list widget, you can use a $let widget to set the .state variable, where the assigned value is constructed using “filtered transclusion”.
  • The title filter operator is not needed… just refer to the <.state-prefix> variable.
  • Instead of using the addsuffix filter operator to construct the .state value, you can use separate filter runs for each part of the value, and then connect them all using +[join[]]
2 Likes