Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Export the Same Notes to Multiple Formats
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1412460228

Message started by Josh Fishburn on Oct 4th, 2014, 6:03pm

Title: Export the Same Notes to Multiple Formats
Post by Josh Fishburn on Oct 4th, 2014, 6:03pm

I have a Tinderbox file that currently exports to a Markdown-formatted document via a series of templates and prototypes similar to the ones described in this article on writing an article in Tinderbox: http://decafbad.com/2010/06/tinderbox-article-tutorial/article.html.

I would like to simultaneously export the same set of notes using another set of templates designed for a LaTeX-formatted document, but one can only assign one template to any given note. I'm not sure how to go about this - does anyone have suggestions? I'm willing to accept that I'm going about this entirely the wrong way, but at this point I'm stumped!

Title: Re: Export the Same Notes to Multiple Formats
Post by Mark Bernstein on Oct 4th, 2014, 6:51pm

Use an envelope template that switches formats depending on a configuration attribute.

   ^if($Latex(/config)) ..... ^else .... ^endif

On the whole, this is not easy.

Title: Re: Export the Same Notes to Multiple Formats
Post by Mark Anderson on Oct 5th, 2014, 3:48am

As MB indicates, it's cumbersome of lots of discrete notes need an alternate. If however it is a case of a few discrete branches needing alternate exports, then simply make a note for each alternate export and use an ^include^ to seed the process. To see the latter technique download the source TBX for aTbRef. See how all the content - normally exported as single HTML pages - is also exported as a sitemap. The fact the latter is also HTML isn't the significant as either set of exports could be using other forms of mark-up (or none!).

Note, re the switch technique MB describes, to export in 2 different format changing the master switch between each, 3 times for 3 different formats, etc.

At a more simple level, the default $HTMLExportTemplate - empty by default in v6 - simply tells any exporting note which template to use. This doesn't stop some/all exporting notes (or prototypes) having their $HTMLExportTemplate set different;y.  This allows for the scenario where you don't want the notes to export more than once but some notes need to use different formats or different layouts within the same format.

Or you can mix and match all the above.  When moving beyond basic export a good starting tip is not to rush to concentrate on the outcome but to identify which notes need to use which template(s) and how you will set and control those differences.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.