Tinderbox Forum

Inserting body of a note into the body of another

I trying to write a blog article. I’d like to be able to pull the body text of another note (a note with a definitions prototype that defines a specific term) into the body of my article on export. Linking or ziplinking to the note does not do it as this just provides a linked piece of text and does not insert the body of the other note. Any ideas?

My reasoning for this is I only want to be editing this definition in one place and I don’t want to be copying and pasting it all over the place.

Make (and then use as needed) a Stamp

For example

$Text=$Text+$Text("Definition Note");

When used, this will append the text of a note named “Definition Note” to the selected note(s).

Play around with this in a test document – don’t use stamps that are partially or wholly destructive without testing first.

Thanks, but I’m not sure this would work because I want to write around the inserted text, not programmatically create the entire article. I’ll play around some more and see what I can figure out.

If you are looking for transclusion, Tinderbox does not support transclusion. You can of course include text from multiple sources in an export, and view the results in Preview. This requires fiddling with templates and export code – ^include()^, or ^text(), etc.

(FWIW, many forget that export code can exist in a the body of a note as well as in templates.

Read Help, aTBRef, and so on for more details.

1 Like

Got it, thanks! Very helpful.

Also look at ^children^ which pulls in the ^text^ of each of the currently-processed children.

I’d recommend you (skim-)read through all the codes listed for Export codes and you’ll have an overview of what is possible.

Export is, in my experience, very flexible. Importantly, (HTML-type) export it is based on the document’s underlying outline. I.E., if you make a doc and just export it, by default you’ll get a page exported per note and stored in the outline structure.

Although you can make pages from more than one source note, what can’t be done without post-processing is making a composite page and linking to anchors in the those pages (i.e. #anchor suffixes on link URLs).

Thanks! Yes, I think this will work well on many fronts. I just have to get better at using aliases. For instance, if I find a definition I want to pull in I can create an alias and pull it in. Now I just have to figure out a clean and efficient way to do this. Thanks again.

1 Like