tags:

views:

36

answers:

1

Say I'm looking at a long web doc.html which has no tree view on the left, but I can hack a local tree view file with level, name, href like

+ 1 US href=  ("+" button expands, "-" folds)
  2 Alabama href=
  3 ...
  2 Alaska href=
  ...
+ 1 Canada href=
  ...

Is there a small API that can generate a tree viewer / navigator from this,
either side by side in the same browser window with the remote web pages, or in a separate window ?
I'd prefer Python (don't know Java or php), use Macosx and Firefox.
(The tree view lines can of course be reformatted to xml or whatever the API wants.)

A: 

If the tree view lines can be formatted as XML then they could also be formatted as HTML.

Perhaps you could output the tree view lines as a nested set set of HTML unordered lists. If you set the class of the top level <UL> to "mktree" then you could use the DHTML tree library found at Matt Kruse's site. The javascript library will render your lists as a tree navigator.

An example of the required HTML format.

<ul class="mktree" id="tree1"> 
    <li>cache/
     <ul> 
      <li>delete_me.txt</li> 
     </ul> 
    </li> 
</ul>
Alex Stoddard