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
OPML Export from Tinderbox to OPML Editor (Read 8541 times)
Jack Baty
Full Member
*
Offline



Posts: 96

OPML Export from Tinderbox to OPML Editor
Sep 28th, 2012, 11:00am
 
I'm using Dave Winer's OPML Editor and World Outliner component to publish a number of small websites. Everything in the entire system is an outline, and the whole process is quite neat.

The problem is that I much prefer actually working in Tinderbox. What I'm trying to accomplish is..

1. Write/Edit/Outline in Tinderbox.
2. Export to OPML readible by OPML Editor for publishing

OPML Editor does not seem to support the additional _note attribute in OPML, so what I've done is, if a Tinderbox note contains $Text, I simply write that out as a child node in the export. This was a fairly simple adaptation of the built-in OPML-item template.

What I'm now struggling with is that OPML Editor treats paragraphs within a node as children, so I need to convert each paragraph in a note's $Text to individual <outline /> nodes as children of the parent Note's node. It sounds very complicated, so maybe examples would help.

My template looks like this (I've only worried about the second part after the "elseIf" (when there are no children):

Code:
^if(ChildCount)^^indent("\t",^value($OutlineDepth(parent)-1))^<outline^if(Text)^ text="^value(attributeEncode($Name))^" _note="^value(attributeEncode($Text))^"^else^ text="^value(attributeEncode($Name))^"^endIf^^if($Checked)^ _status="checked"^endIf^>
^children(/Templates/OPML/OPML item)^^indent("\t",^value($OutlineDepth(parent)-1))^</outline>
^else^^indent("\t",^value($OutlineDepth(parent)-1))^
<outline text="^value(attributeEncode($Name))^"^if(!Text)^/^endif^>
^if(Text)^<outline text="^value(attributeEncode($Text))^"/> ^endIf^
^if(Text)^</outline>^endIf^
^endIf^
 



What I think has to happen is that the last instance of this...

Code:
<outline text="^value(attributeEncode($Text))^"/> 



...needs to become a series of separate outline elements if $Text includes more than one paragraph...

Code:
<outline text="Text in paragraph one" />
<outline text="Text in paragraph two" />
<outline text="Text in paragraph three" />
 



...or something close to that, anyway.

It's a bit hard to explain, but if anyone has suggestions on where to begin, I'd appreciate it.

Back to top
 
« Last Edit: Sep 28th, 2012, 11:01am by Jack Baty »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OPML Export from Tinderbox to OPML Editor
Reply #1 - Sep 28th, 2012, 12:48pm
 
It is important to realise that Dave Winer's tools don't include things like "_note" because they aren't part of the OPML standard. That attribute and a few others are non-standard additions that were, I think, originated by OmniOutliner. As the later was an early high profile adopter other OPML consuming apps followed suit. So, the user's assumption is that bits they expect of the format are standard when they aren't. No right or wrong, but it does explain why you're TB/OPML Editor workflow is running against the gears.

Unless you only go one way from TB - > OPML editor, the simple solution is to write title-only notes. Then the two apps will be using the same assumed data structure.

I can see a solution by fiddling with $HTMLParagraphStart but it's a fragile kludge that requires you not use any rich text features (bold, italic, etc.) in your text not use text links. Given the fragility of the solution, I think the best method is simply not to use $Text in TB, or don't use Dave's tools and publish directly from TB.
Back to top
 
 

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



Posts: 96

Re: OPML Export from Tinderbox to OPML Editor
Reply #2 - Sep 28th, 2012, 1:15pm
 
Thank you, Mark. Yes, I realize I'm swimming upstream a bit here. I've used Tinderbox for HTML publishing in the past but we never got along that well. Tinderbox is so flexible in that regard that I sometimes become overwhelmed and give up. I realize this is my shortcoming, but there it is.

The stuff Winer is working is quite interesting, and I'd really like to play along. One nifty feature is that I can create an OPML document in my Dropbox/Public folder, then simply add that URL as an "include" node in the OPML editor, and it will be pulled in via HTTP when rendering the parent outline. This would let me maintain a series of OPML content documents on my desktop, but have the latest version "automatically" published when the page is rendered via the World Outline software (part of Winer's suite)

This is all open-source stuff, so there's nothing preventing some network-aware software outline (aka Tinderbox) from implementing the same protocols. How cool would it be to open a web-accessable OPML document via URL in Tinderbox, hit "Save" and have it automatically pushed back out to S3 (or whatever) as a fully rendered HTML document/outline/site. That's what World Outline does and it's awesome. I'm just trying to use Tinderbox as the OPML editor as much as possible, since it gives me so much more than just a simple outliner.

I'll probably just end up doing what you suggest in the meantime (not use the $Text in notes) but that changes the way I use Tinderbox. Was hoping for both the cake and the meal Smiley

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OPML Export from Tinderbox to OPML Editor
Reply #3 - Sep 28th, 2012, 2:06pm
 
The solution is simple, just don't use $Text in your notes and export only attributes in the OPML standard and then you'll be in assumption-synch with Winer's tools.

Quote:
This is all open-source stuff, so there's nothing preventing some network-aware software outline (aka Tinderbox) from implementing the same protocols.


Less simple than assumed. TB is collection of note that have a title and text and much of TB's heavy lift leans on the latter.  It's a testament to TB's flexibility that it can create/consume OPML, given the different conceptual structure. I think the issue is that many TB users want their $text content.  If so, the guy to call is Dave W as that's the restrictive end of the data chain.

Anyway, for OPML publishing, as long as you don't use $Text in your notes you'll be fine. Or rather, don't put OPML targetted info in $Text and remove all $Text-related code from your OPML export templates. For the built-in templates I think this means changing the built-in 'OPML-item' template code to:

Code:
^if(ChildCount)^^indent("\t",^value($OutlineDepth(parent)-1))^<outline text="^value(attributeEncode($Name))^">
^children(/Templates/OPML/OPML item)^^indent("\t",^value($OutlineDepth(parent)-1))^</outline>
^else^^indent("\t",^value($OutlineDepth(parent)-1))^<outline text="^value(attributeEncode($Name))^"/>
^endIf^
 

Back to top
 
 

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



Posts: 96

Re: OPML Export from Tinderbox to OPML Editor
Reply #4 - Sep 28th, 2012, 2:16pm
 
Indeed, and thanks. I hope I didn't come across as suggesting that Tinderbox is the shortcoming here. I'm simply exploring some new ideas and trying to find ways to make my favorite software of the last 10 years play nicely with something new that I'm also finding exciting. They feel like cousins who've never met. I think they'd like each other Smiley

You're exactly right. By simply not using $Text I can route around the entire problem for the most part. But as you said, we want our $Text content as well.

I appreciate your comments!

Back to top
 
« Last Edit: Sep 28th, 2012, 2:17pm by Jack Baty »  
  IP Logged
Jack Baty
Full Member
*
Offline



Posts: 96

Re: OPML Export from Tinderbox to OPML Editor
Reply #5 - Sep 28th, 2012, 2:25pm
 
And by doing it this way (no $Text in notes), I can copy longer existing notes, past them as a child note, and "Explode..." them by paragraphs, giving me something pretty close to what I need. Works for now.

BOBW!

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OPML Export from Tinderbox to OPML Editor
Reply #6 - Sep 28th, 2012, 3:16pm
 
Jack, no, I didn't read you as impugning TB; I was writing for the long tail. Having learned more than I imagined about OPML in the last few years I'm conscious that what we the public think it is is some way from what Dave W actually designed which leads to occasional confusion and disappointment!
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