Q1. In you original test TBX, the ‘note’ you were exporting didn’t export any data because:
- $HTMLDon’tExport was
true
(non-default). This tell Tinderbox to ignore processing the note when it is part of an export call (whole document or only selected item(s)).
- your document had no export template. so, even having fixed the last point (i.e. $HTMLDon’tExport is now
true
), the note exports nothing its template—or lack of a template—defines not exportable data.
So, what sort of template does your document need? Not a normal HTML export template as you just want only the $Text in plain text from. In other words, the text as you see it in text with no further processing. There are two ways to specify that in export code:
^text(plain)^
^value($Text)^
In my template I use the last of the two, but either is OK. You will also see from the edited TBX I posted that the template I added, called ‘just-text’, that the only content of the template (i.e. the template note’s $Text) is:
^value($Text)^
When applied to a note and the note is exported, Tinderbox simply takes the contents of $Text, without additional processing and saves it as a file using the desired file name and extension—in this case ‘note.qmd’.
So that is what ^value($Text)^
does … the ‘how?’.
Now we know (see above) the point in the template, we simply make a new template in your TBX’s /Templates
container. Here is the such a template shown in my earlier demo:
Now you have the template, it is available for use as a template. How to apply it. You can set it via action code:
// using only template name
$HTMLExportTemplate = "just-text";
// or
// using only template path
$HTMLExportTemplate = "/Templates/just-text";
As long as the template’s $Name is unique in the TBX, using just the template $Name is OK, otherwise use its full $Path.
Easier, at least until you are more practised with export is to set the export template via the Export Inspector using the pop-up illustrated below:
Q2. Using the template
I’m not sure if I fully understand, but I think your question is “how do I apply this new template to other notes being the test note above?”.
OK, a template is a note used to tell Tinderbox how to format the data exported from a note. Rather in the same way a prototype can configure one note or many notes, a template can be used for export by one note or by many notes. In the latter case all notes using the same template are precessed the same way, but using different data (from the note being processed for export). Thus in aTbRef >95% of the 2,000+ HTML pages are created via a single template being used by different notes.
Put simply export is a case of: source note data (the ingredients) + template (the recipe) → exported note
Where the note and the template live in the document are not an issue. Any note you wish to export must be allowed to export (see Q1 above) and have a template assigned. So, as you add new notes that will export to QMD files, give each one the correct template.
Tip: if you will have many such QMD notes, consider using a prototype for all such files. Then set the desired QMD export template in the prototype as this will set it automatically for any note using the prototype. Once set up, having the correct export template is one less thing to forget when making a QMD note.
Summary. Here, we’ve moved away from Quarto issue to basic export issues. Given the questions asked here, I would commend reading up on formatted (i.e. ‘HTML’ ) export. The problems raised come not from the Quarto problem but simply from not understanding how export works. I don’t mean that in a disrespectful manner, but simply that taking a little time to understand the general functioning of export will mean you will already know the answers to these questions when they arise.
I hope this helps.