The text is: ^include(“A title here”)^ and yes, “Fiche” is a copy of “MD note root”.
My file is attached to this message. I must have made a mistake somewhere. Thank you for your help.
Essai.tbx (95.5 KB)
The text is: ^include(“A title here”)^ and yes, “Fiche” is a copy of “MD note root”.
My file is attached to this message. I must have made a mistake somewhere. Thank you for your help.
Essai.tbx (95.5 KB)
Great to see these examples of Markdown export. I hadn’t noticed the introduction of the TextMarkdown attribute.
Based on your file, what works for me here is this:
I get this result:
This configuration works, thank you, but in this case, Introduction becomes of level 2. However, I need it to be of level 1. In fact, the note called Manuscript is not a chapter or a section. It is a container that has to contain chapters and sections.
OK, the reason your earlier trial failed for the export stub was because its ^include()^ sated the container name as in my original demo “A title here” but you’d renamed the latter to “Introduction”. This underscores my earlier point of changing one or a few things at a time and checking. That way if the change breaks it’s generally easier to figure out what broke. Above, we’d discover we were calling a note “A title here” that no longer exists. So, if we fix the export stub’s $Text:
^include("Introduction")^
We get:
Corrected file: Essai2.tbx (95.6 KB)
But, if you want the export stub to export all 3 outline branches as a single Markdown,
Then the stub’s $Text is this:
^include("Introduction")^
^include("Développement")^
^include("Conclusion")^
Demo: Essai3.tbx (97.0 KB)
Or, if you want 3 *discrete stubs, one for each source branch in the outline:
Demo: Essai4.tbx (97.0 KB)
Even if only building/coding for your self, it can help to write down when you plan. That act forces you to resolve ambiguities in the description that the mind’s eye happily resolves (as the ‘know’ the answer in that moment. But code is less flexible, it wants a description where the implementation or outcome leaves no room for guesses.
Still, I hope the demos above show how little effort is needed to adjust things , albeit once you know what to adjust.
Thank you from the bottom of my heart for all this work! I have one last — I hope — question: if I want to add numbered sections to my document, how should I do it? The one I wanted to add is not numbered. Am I missing again something?
It’s worth noting a nested assumption here. There are potentially two ways to think of export:
†. Note we use the ‘HTML’ option even if our templates are constructed to export, Markdown, CSV, JSON, etc.
‡. Indeed, this makes it really easy for a task of updating a single note’s HTML file in aTbRef. Edit the note. Export selected file and it goes to the right place .. is if I’d re-exported the whole document (which long ago is what one would have had to have done.)
§. Note that it is only root-level notes that ofter the ability to save elsewhere. This is why the export stubs in the demos above. It is also why I advise people doing long-term work 9i.e. not just tinkering) to put their map/content inside a root level container, leaving the root clear for things like template container, export stubs. aTbREf gives a mature example of this, below,: imagine the mess if the room level also contained the top layer of aTbRef content.
By manipulating my file, I think I understand: I need to launch (“Run now” in the Edict section) the MD root note — “Fiche” in my file.
In you But, your example document has no ‘Perspectives’ note. The screen grab doesn’t show the source of this info or the code used. ![]()
Argh! I missed—because $HeadingLevel had already been set—that you were building off my demo but have deleted the prototype that sets the $HeadingLevel for each discrete ‘report’, e.g. Introduction/Développment/Conclusion should all have a prototype that is missing.
… have to stop for lunch, answer in a bit!
If you don’t want ‘Manuscrit’ included and want the notes within it bumped up a level, another simple way might be to make these small changes:
^children(/Templates/Markdown page/Markdown item)
Result:
I too look forward to Mark’s suggestions for adding section numbering (not usually included in Markdown, but sometimes useful)!
So, we’ll put back the prototype that sets heading level, so we’ll add a prototype"Petite racine"† (‘little root’). Important to note customisations:
$Prototype="Note";, so all children set the prototype ‘note’.For the prototype ‘Note’:
$Prototype="Note";, so all children set the prototype ‘note’.I have added a badge to each of these two prototypes but only to help testing. Feel free to remove/alter them in your own use.
I also added a new ex ‘Perspectives’ note at path /Manuscrit/Quelque chose/Perspectives with a child note Esprit d'escalier just to flesh out the test. Note that ‘Perspectives’ is deliberately at a different $OutineDepth to ‘Introduction’ so as to test the Edict code in the ‘Petite racine’ prototype. I also added a line in the $Text of ‘Stub d’exportation’, thus:
^include("Introduction")^
^include("Développement")^
^include("Conclusion")^
^include("Perspectives")^
Result:
I think I’ve now covered a few holes in moving my idea into your framework. Question still welcome! Her’s the file: Essai5.tbx (99.5 KB)
†. I hope that is a fair translation. I’m just trying to avoid more unintended errors when replacing my English examples with French-named ones. as my schoolboy French is a bit rusty, I’ve used Google Translate, so I hope it makes sense. ![]()
Thank you for your suggestions. The way I use Markdown includes the principle of automatically numbered sections.
It works perfectly. Thank you again for your patient support. This setup will allow me to use Tinderbox and RStudio together and dynamically.
“Petite racine”, it sounds nicely in French. ![]()
Good to hear and this is the fun of communities like this, to share with others. ![]()
BTW, we’ve run several meetups on this, e.g., Tinderbox Training Video 53 - Working with Markdown and Templates in Tinderbox. Be sure to review the complete video library, there are several templates you can download.