a valuable lesson about li [02/08/2008 22:44:30]
So, I've been working on this outliner, and it's been great for organizing and indenting simple strings. But now I want to add arbitrary objects to the outline, and it's taken a lot of heavy thinking to get right.
Specifically, I want some of the items in the tree to represent trouble tickets or new, unread emails, and others to contain GTD-style next action items with a time estimate. (GTD doesn't really call for an estimate, but being able to put an estimate on an item is a good indicator that it really is a performable action and not just a stray thought - especially if the estimate is in minutes instead of hours, days, or months.) Also, I just want some of the nodes to allow basic HTML tags like em, strong, code, and anchor links.
The question is, how do you store this?
The plain-string version uses the XOXO outline format, which is basically just the subset of XHTML that deals with lists. XOXO is nice because it means your outline files are also valid XHTML fragments.
Unfortunately, everyone knows you can't put arbitrary XHTML nodes inside the li element. You can't put headers or paragraphs or images or preformatted text.
Except it turns out list elements can include just about anything.
I have no idea how I didn't know that.
Anyway, the upshot of this discovery is that my outline files can remain 100% pure XHTML, so what I'm building isn't just an outliner but also a web page authoring tool. Neat.
