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 >> Exporting to word as in The Tinderbox Way
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1187020212

Message started by Peter Sass on Aug 13th, 2007, 11:50am

Title: Exporting to word as in The Tinderbox Way
Post by Peter Sass on Aug 13th, 2007, 11:50am

I have read Mark Bernsteins Book "The Tinderbox Way" and enjoyed it very much. Before I read it I had never gotten around to make export to html work. I am sorry to say that allthough I now understand a bit more about how it works, I am still not there. Take for exampel this example from chapter 11: It should show how one can write an article in tinderbox and then make it in to a word document via export to html.

The outline view of the tinderbox document has a hierarchy like this:

     Roman Shops
           Introduction
                 The nature of the evidence
                 Kinds of shops
           Bars, cafes, restaurants
                 Groceries
                 Winesellers
                 Clothiers
                 Laundries
                 Leather goods
                 Booksellers
                 Barbers
           Markets and Malls
                 Rome
                 Ostia
                 Pompei

These are all note names. If this was an article about roman shops there would of course have to be more than note names. There would also have to be some text. So say that the title of the article is "Roman Shops" and there are to levels of headings. The first level one heading is "Introduction", and the first level two heading is "The nature of the evidence". I have placed a line of text inside each level two note like so: "Some text for The nature of the evidence"

I have then exported with the templates suggested in the book, and get the following result:

Code:
<html
     <head> <title> Roman Shops </title>
     </head>
     <body>
     
     <p>Some text for The nature of the evidence</p>
     <p>Some text for What we don't now</p>
     
     <p>Some text for Bars, cafes, restaurants</p>
     <p>Some text for Groceries</p>
     <p>Some text for Winesellers</p>
     <p>Some text for Clothiers</p>
     <p>Some text for Laundries</p>
     <p>Some text for Leather goods</p>
     <p>Some text for Booksellers</p>
     <p>Some text for Barbers</p>
     
     <p>Some text for Rome</p>
     <p>Some text for Ostia</p>
     <p>Some text for Pompei</p>
     
     </body>
     </html>

These are the templates used above:

DocumentTemplate.html

Code:
     <html
     <head> <title> ^title^ </title>
     </head>
     <body>
     ^justChildren
     </body>
     </html>

TextTemplate.html

Code:
     ^text^
     ^justChildren^

h2Template.html

Code:
     ^if(^get(WordCount)) ^text^
     ^else <h2> ^title^ </h2> ^endif

As you can see I dont get any of the headings, only the text inside the notes.
This of course is not what I want, so I have tried to muck about with the templates to see if I could get something useful. I get different results, but nothing useful so far.

Fx if I use ^children instead of ^justChildren in the DocumentTemplate.html, then all text lines are repeated, but still no headings, like so:

Code:
     <p>Some text for The nature of the evidence</p>
     <p>Some text for What we don't now</p>
     <p>Some text for The nature of the evidence</p>
     <p>Some text for What we don't now</p>
     .
     .
Have any of you tried your hand at the example in chapter eleven, and have you come up with better results, then I would like to hear how you did it. If there is fault with the example in the book, then it would be nice with an errata-page somewhere on the eastgate site. There isn't one now, is there?

Peter Sass





Title: Re: Exporting to word as in The Tinderbox Way
Post by Mark Bernstein on Aug 13th, 2007, 11:57am

The note template you use is


Quote:
     
     ^if(^get(WordCount)) ^text^
     ^else <h2> ^title^ </h2> ^endif


This means, "If the note has some text, export it.  Otherwise, export the title as a second level heading."    If you wanted to export the title AND the text, you might write


Quote:
     
    <h2> ^title^ </h2>    ^text^


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.