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
very basic formatting of simple HTML outlines? (Read 10467 times)
Rob Forsyth
Full Member
*
Offline



Posts: 63

very basic formatting of simple HTML outlines?
Oct 17th, 2008, 5:15am
 
I am exporting quite complex outlines using recursive HTML templates based on the SimpleOutline examples in Tinderbox way and all is fine except that the only formatting that survives this step is outline position.

I'd like the exported outline to preserve some other basic formatting properties of the outline in Tinderbox (particularly the note title font colour, but style (italic etc) and font would be helpful) as many of these are set by agents and are salient.

I suspect this is trivial to someone who understands CSS, but can we have a very basic guide?!

Thanks
Back to top
 
 
  IP Logged
Rob Forsyth
Full Member
*
Offline



Posts: 63

Re: very basic formatting of simple HTML outlines?
Reply #1 - Oct 17th, 2008, 5:42am
 
Sorry - should have added by way of background that I am emailing the exported single HTML file to colleagues as a way of summarising our discussions and agreements as represented by the TBX outline. I presume this would suggest a solution that "hard codes" font colours etc into the actual HTML rather than relying on separate style sheets would be preferrable
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: very basic formatting of simple HTML outlines?
Reply #2 - Oct 17th, 2008, 6:45am
 
Taking the last first.  There's no reason you can't use an inline <style> element in the <head> of the main HTML page to avoid needing an external CSS file.

So, assuming you're using the Tinderbox Way method from around pages 136-137 you're getting code like:
Code:
<ol>
   <li><p>Outline</p>
	<ol>
	   <li><p>Public Services</p>
		<ol>
		   <li><p>Streets</p>
		   </li>
		</ol>
	   <li>
	</ol>
   </li>
</ol> 


...but want...
Code:
 <ol>
   <li><p class="level_1">Outline</p>
	<ol>
	   <li><p class="level_2">Public Services</p>
		<ol>
		   <li><p class="level_3">Streets</p>
		   </li>
		</ol>
	   <li>
	</ol>
   </li>
</ol> 


...using style in the HTML page headead like so:
Code:
<head>
   <style>
   .level_1{/* CSS style info goes here }
   .level_2{/* CSS style info goes here }
...etc. 



Make a rule or action that sets this action code:
Code:
HTMLFirstParagraphStart='<p class="level_' + $OutlineDepth + '">';
HTMLParagraphStart='<p class="level_' + $OutlineDepth + '">'; 



Note! In Tinderbox we normally use double quotes (") to enclose string literals (i.e. actual text) in actions but here we need to include some as part of the HTML that will be the attribute value we're creating and you can't escape a double quote in this manner: "class =\"level_". The workaround comes from the fact that as long as the quote types match TB - like the command line - allows string quoted in either single or double form. So, here we use single quotes allowing double quotes to be treated as text rather than the delimiters of the text.
Back to top
 
« Last Edit: Oct 17th, 2008, 8:44am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rob Forsyth
Full Member
*
Offline



Posts: 63

Re: very basic formatting of simple HTML outlines?
Reply #3 - Oct 17th, 2008, 9:56am
 
It's very possible I'm misunderstanding this, but isn't this a way to assign styles to different levels of the outline (akin to a Microsoft Word style sheet)? What I want to be able to do entails individual notes at the same level in the outline having different colours (say), preserving/inheriting the format attributes of the original note in the TBX file as these reflect the actions of agents on the notes

Thanks again!

Rob
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: very basic formatting of simple HTML outlines?
Reply #4 - Oct 17th, 2008, 11:23am
 
Fine, instead of using OutlineDepth simply either hard code the desired style, (e.g. 'mystylename') in the rule:
Code:
HTMLFirstParagraphStart='<p class="mystylename">';
HTMLParagraphStart='<p class="mystylename">'; 


... or put the style name in a user attribute and use that where I used OutlineDepth. We use attribute StyleName to hold a value "mystylename" and use the rule:
Code:
HTMLFirstParagraphStart='<p class="' + $StyleName + '">';
HTMLParagraphStart='<p class="' + $StyleName + '">'; 


If that's still not right, it may be quicker for you to simply code up an HTML page as you want it to look, put in online and let use reverse engineer it back into TB form. I suggest this as it seems you're clearer about how you want the end result to look than you are about how to get there.  Smiley
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rob Forsyth
Full Member
*
Offline



Posts: 63

Re: very basic formatting of simple HTML outlines?
Reply #5 - Oct 18th, 2008, 6:41am
 
I'm probably making this more complicated than I need. I'd settle for the SimpleOutline output:

<li>^title^</li>
^if(^get(ChildCount))
<ol>
^justChildren(SimpleOutline)
</ol>
^endif

modified so that Title reflects the colour of the particular note in the TBX outline

Thanks again
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: very basic formatting of simple HTML outlines?
Reply #6 - Oct 18th, 2008, 8:27am
 
OK, that's even easier:
Code:
<li style="color:^get(Color)^;">^title^</li> 


or
Code:
<li><span style="color:^get(Color)^;">^title^</span></li> 



[Tested in v4.5.2]
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rob Forsyth
Full Member
*
Offline



Posts: 63

Re: very basic formatting of simple HTML outlines?
Reply #7 - Oct 20th, 2008, 2:21am
 
That's great. Thank you
Back to top
 
 
  IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: very basic formatting of simple HTML outlines?
Reply #8 - Nov 10th, 2008, 10:34pm
 
I know this thread has died down a bit, but just in case anyone is still paying attention:

Is there anyway to use fairly simple statements, like those offered latest in the thread, to have the title of each item also reflect the bold a/o italic of the note?
Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: very basic formatting of simple HTML outlines?
Reply #9 - Nov 11th, 2008, 6:35am
 
Titles are bold if NameBold is true. They are only in italic if they are aliases. As far as I know you can't set Bold or Italic via the font  - unless you chose a font by name that is by typeface design either both bold or italic.

Happily, bolding & italics via NameBold & alias state can be captured. Here's some code:

Code:
<html>
<head>
<title>^title^</title>
</head>
<body>
<ul>
^if(NameBold)^
  ^if(Alias)^
  <!-- Bold and Italics -->
  <li style="color:^get(Color)^;"><b><i>^title^</i><b></li>
  ^else^
    <!-- Bold only -->
    <li style="color:^get(Color)^;"><b>^title^</b></li>
  ^endIf^
^else^
  ^if(Alias)^
    <!-- Italics only -->
    <li style="color:^get(Color)^;"><i>^title^</i></li>
  ^else^
    <!-- Neither bold nor italics -->
    <li style="color:^get(Color)^;">^title^</li>
  ^endIf^
^endIf^
</ul>
</body>
</html> 



IMPORTANT: Alias is a hidden internal attribute in TB and you won't see the correct export code in HTML view for aliases but they will export correctly.

Note that TB doesn't have an 'else if' conditional syntax so you must nest put each successive test in the 'else' fork of the previous test, remembering to close all tests when done.



Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print