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
Hierarchical bullet-point list (Read 4369 times)
Stephane
Full Member
*
Offline



Posts: 71
@istib
Hierarchical bullet-point list
Mar 21st, 2011, 6:53pm
 
Hello all,


I have managed some mildly challenging exports before (LaTeX, iCal..), but am struggling with a simple bullet point text export. What I want is to maintain parent/children hierarchy (using tabs) and have a hyphen before each note, like so:

- A
  - B
  - C
- D
  - E
      - F


My incorrect template is such:

"
- ^title^
     ^children(BulletListTemplate)^

"

any thoughts?

Thanks,
Manuel
Back to top
 
« Last Edit: Mar 21st, 2011, 6:54pm by Stephane »  
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Hierarchical bullet-point list
Reply #1 - Mar 21st, 2011, 11:29pm
 
You might be better off with HTML export -- much easier than LaTeX!  But for what you want, ^indent is you friend.

Take a lok at the help; if you need more, ask and we'll walk it through.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Hierarchical bullet-point list
Reply #2 - Mar 22nd, 2011, 5:29am
 
Mark's recommendation re HTML is one I'd concur but happily in this scenario, a template for Nakakoji export in the style you describe is possible. Starting assumption: notes A and D are at outline root level ($OutlineDepth of 1).
Code:
^indent("\t",($OutlineDepth-1))^- ^title^^if($ChildCount)^
^children(/Templates/BulletListTemplate)^^endIf^
 

 IMPORTANT!  Code ends on line after line ending ^endIf^, i.e. add a line return after the latter.

This still means exporting A's tree and D's tree separately, so we want to move all the content inside a container (assumed for now at root level). The container uses this template:
Code:
^children(/Templates/BulletListTemplate)^ 



As the exported notes now all have an $OutlineDepth one higher than previously, we must tweak the main template like so:
Code:
^indent("\t",($OutlineDepth-2))^- ^title^^if($ChildCount)^
^children(/Templates/BulletListTemplate)^^endIf^
 


See how that in order to make A have no indent tabs we now need to subtract 2 from its $OutlineDepth, it now beingone level deeper  ($OutlineDepth is now 2) by being inside a root level container (for which $OutlineDepth is 1).

Notes:
  • I'm using an internal template so the full path to the template must be specified or the template doesn't work. For external templates you just use the filename of the template).
  • If the longer syntax of ^indent^ is used, the indent character must be cited as a quoted string. \t is how a Tab character is designated.
  • The outline depth argument to ^indent^ may need adjusting if A & D are not root level.
  • N.B the line return inside the ^if^ statement is deliberate. Otherwise, items with no children would be followed by a blank line. I find this aspect - controlling whitespace
  • ^indent^ code syntax.
Back to top
 
« Last Edit: Mar 22nd, 2011, 5:36am by Mark Anderson »  

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



Posts: 71
@istib
Re: Hierarchical bullet-point list
Reply #3 - Mar 22nd, 2011, 8:36am
 
Thanks for the pointer to ^indent^, it works a treat.

Mark B: my mention of LaTeX refers to me tweaking a preexisting HTML->MMD->LaTeX export workflow that has been posted on this forum before.

Mark A: Thank you very much for the detailed explanation, it is most appreciated!
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print