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
Unexpected Line Break (Read 9288 times)
Simon Knight
Full Member
*
Offline



Posts: 80

Unexpected Line Break
Sep 15th, 2011, 12:18pm
 
I have only just started looking at export templates and I have created a text output template that grabs data from my notes attributes using the following line ^value($Date),      ^value($Text),      ^value($HoursWorked),      ^value($Charge) the line ends with the default mac line end i.e. I just pressed the return key.  When used some longer entries in $Text cause the output to wrap to a second (and I guess subsequent) line.  Where is this wrap being set?  I have looked at the attributes but not found anything.

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

User - not staff!

Posts: 5689
Southsea, UK
Re: Unexpected Line Break
Reply #1 - Sep 15th, 2011, 6:05pm
 
What tool are you using to view the output? Might that be soft-wrapping to output for display?
Back to top
 
 

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



Posts: 80

Re: Unexpected Line Break
Reply #2 - Sep 16th, 2011, 2:15am
 
Mark,

You are quite correct, both text edit and Tinderbox are adding a line break at the righthand end of the document.

Thanks (again!)

Simon
Back to top
 
 
  IP Logged
Ema
Ex Member




Re: Unexpected Line Break
Reply #3 - Oct 8th, 2011, 7:55am
 
I made the same mistake but it took long for me to understand it.You are lucky to get it instantly.Thanks to Mark.

Edited:
user deleted - signature spam
Back to top
 
« Last Edit: Nov 3rd, 2011, 6:36am by Mark Anderson »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Unexpected Line Break
Reply #4 - Oct 8th, 2011, 9:09am
 
We add an implicit return after $Text because that's what we expected most people would expect.  For the simplest case, a beginner who tries the template

    ^title ^text

might be surprised to find that the second note's title collides with the first note's text.  (Simon Knight might reorder the fields so $Text is the last column, and then all might be well)

We'd be open to suggestions for handling this question.
Back to top
 
« Last Edit: Oct 8th, 2011, 9:10am by Mark Bernstein »  
WWW   IP Logged
Carol smith
Ex Member




Re: Unexpected Line Break
Reply #5 - Oct 21st, 2011, 3:50am
 
hey mark can you please explain that in a bit detail, i got confused in the collision between the second note and the first note text. Roll Eyes Undecided

Edited:
user deleted - signature spam
Back to top
 
« Last Edit: Nov 3rd, 2011, 6:37am by Mark Anderson »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Unexpected Line Break
Reply #6 - Oct 21st, 2011, 10:46am
 
Let's suppose we have the text export template

    ^title: ^text

This is perhaps the first thing that people will try, after all.  We try exporting, and what we expect is:

    Chaucer: Cressida
    Shakespeare: Juliet
    Austen: Darcy

but what we actually see is

    Chaucer: CressidaShakespeare: JulietAusten: Darcy

To avoid this very common puzzle, we add an implicit carriage return at the end of ^text.
Back to top
 
 
WWW   IP Logged
Robert Matzken
Full Member
*
Offline



Posts: 21

Re: Unexpected Line Break
Reply #7 - Oct 27th, 2011, 10:47am
 
Mark B asked for suggestions:

1) You might consider introducing a new System Attribute called $TextNR.
NR stands for No Return.
The Attribute $TextNR does not actually exist: during export Tbx would still use the value of $Text, but without adding the carriage return. This way, all existing scripts remain unaffected, but you simply add an option for export. I would make it non-editable in the Attribute Inspector.

2) Other approach: An extra checkbox in the HTML Export dialog window. Next to "Quote HTML" there is room for an extra checkbox option: "Add CR to text". The System default will be to have this box checked (again, so all existing script remain valid) but it will allow users to override the automatic addition of the CR.
Back to top
 
« Last Edit: Oct 27th, 2011, 10:47am by Robert Matzken »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Unexpected Line Break
Reply #8 - Oct 27th, 2011, 11:39am
 
Turning Robert's idea around, item #2 would be a preference seeding a #1, Boolean $TextNR. As - for better or worse - most export related attributes live in the 'HTML' system group so $TextNR too might go there (though perhaps as $HTMLExportTextReturn or $ExportTextReturn).
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