The Tree of Widsdom

智慧の樹

Example 1: Text derives from the target note


We can better understand how Tinderbox exports a target note with an example. Let’s say our target note is the following:

TargetNote

This is the main target note we want to export and here’s its content!

Now let’s say you want to export TargetNote with a template that contains only the text "Hello Dolly!"

TemplateOne

Hello Dolly!

The final output would then be

In fact, every target note that you export with TemplateOne will be rendered this way no matter what the target note may actually contain.

Of course, a template is useful precisely because it incorporates the content from other notes. For example, to export the rich text of a note, your template would include the export code ^text^. So if I exported our target note above with a template note that contained this:

TemplateTwo

This is a template note. This could be some header material. And below this line we shall open a wormhole to the note we are actually exporting:

^text^

And here we can cap it off with some footer material.

The resulting exported file will contain this:

In this example the template simply delivered the rich text of the content note and surrounded it with a bit of boilerplate. But a template can also determine how you style that content. It can also change that content according to conditions. And it can also include content from the other 250 attributes that a note has besides its $Text.