I want to make a rich text field for templating, instead of doing this in the automations section. So the ability to reference fields in the rich text field with {{}}, and then in the markdown section in the automation, just reference {{Rich text field}}.
Essentially allow nested markdown templates. This would allow for more user friendly templating. Can this be done with some scripting maybe?
You would need one RTF to define the template, and a second “output” RTF field to hold the interpolated result, plus a Rule that triggers when any of the referenced fields are updated, and calculates a new result value and saves it to the “output” RTF.
If I understand the request correctly, I think it is not possible.
An automation does one level of processing of the markdown at the time of execution.
If you were to type {{Rich text field}}
in the automation, then it would (correctly) interpret that as you wanting the contents of the Rich text field.
If the Rich text field itself contained markdown expressions, e.g.
I would like to show {{This field}}
this will not be processed.
And I should also point out that rich text is stored as markdown, so what gets rendered as
I would like to show {{This field}}
is stored internally as
I would like to show \{\{This field\}\}
so it wouldn’t even work if there were multiple levels of markdown processing.
I see, I’ll give Matt’s idea a shot… But yeah you’re getting the idea right Chris.
I guess this relates to the popular request of having in-line fields in RTF. But then having those fields dynamic…
Anyhow, I’ll leave this here as an idea. I get why it’s not possible at the moment (very easily), but I think it could be quite valuable when templating. (Which is something relevant across many domains).
When you can see consistent benefit of nested markdown templates in your workflows, then you can create a ‘Placeholder’ database that defines a string to be replaced through an automation, with a field Delimiters, the specific characters or sequences (like []
or [[ ]]
) used to mark the beginning and end of a placeholder. An automation 'If RTF changes, replace Placeholders X with … and Y with …etc. Essentially its a templating engine based on automations. This combined with fibery markdown templates will allow for custom and dynamic nestings (e.g. replacement of embedded nodes in real time).
Ooh thanks Yuri!
I’ll give this a shot!