Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Exporting to word as in The Tinderbox Way (Read 5942 times)
Peter Sass
Full Member
*
Offline



Posts: 9

Exporting to word as in The Tinderbox Way
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




Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Exporting to word as in The Tinderbox Way
Reply #1 - 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^

Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print