What I’m trying to do
So, the idea is to have separate base templates to use in another templates on the basis of which regular notes are created.
The problem is that when I try including variables definitions and its usages from separate files, the second part comes undefined.
For example,
I have a definition of a variable in one place like this:
<%*
let type_of_thing = await tp.file.folder()
-%>
and its subsequent usage like this:
type: <% type_of_thing %>
And then I unclude these parts into a final template that would be used by a templater to make a note. So, the second part says that the type_of_thing
is undefined.
Things I have tried
First idea – using ![[file]]
– doesn’t work as templater does not recognize the text as a template.
Second thought – using tp.file.include
. I tried all the variations (file, section, block), with no avail. Every configuration leads to a perculiar result – the first part with definitions executes fine, but the part where usage happens fails.
So, it seems like the files are included before the parsig happens, but in a rather odd fashion.
Would appreciate any help!