The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Marking up outlines: Tagged OPML

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Christian Neukirchen

Posts: 188
Nickname: chris2
Registered: Mar, 2005

Christian Neukirchen is a student from Biberach, Germany playing and hacking with Ruby.
Marking up outlines: Tagged OPML Posted: Dec 18, 2005 1:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Christian Neukirchen.
Original Post: Marking up outlines: Tagged OPML
Feed Title: chris blogs: Ruby stuff
Feed URL: http://chneukirchen.org/blog/category/ruby.atom
Feed Description: a weblog by christian neukirchen - Ruby stuff
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Christian Neukirchen
Latest Posts From chris blogs: Ruby stuff

Advertisement

For a bigger school project I recently had to make some outlines. I used the OPML Editor for that, because it’s the only outliner I seriously can use (despite all efforts to write one for Emacs on my own, but more on that below). After all, it wasn’t a bad experience; the outlining is quick and straight-forward and just works. The keybindings are comparatively sane, and the OPML Editor is open source.

Then, I decided I would like to print out the outline. Hehe.

Of course, the OPML Editor doesn’t have a print function. I don’t even expect that actually. However, the only way to get your data out of it is the HTML export. Good, the HTML looks very basic, the HTML is very unclean ([Winer rant suppressed]) and invalid. I also needed to add a title because I had to turn it in.

Trying to do this the “Macintosh Way”… let’s copy the outline (essentially, a nested <ul>) from Safari and paste into Pages. The indentation got lost. Enough, let’s do it the “Unix Way” and edit the generated HTML on my own. I hacked some <h1> in there and quickly had it how I wanted it. Add some CSS styling and the thing is ready to print.

The next time I had to prepare a similar outline, I thought that the OPML Editor provides an almost perfect way to write. You can easily group related paragraphs and so on. All it lacks is a way to declare some outline entries to be shown as titles (and display them in a different style), or as block-quotes or similar. With a bit of thinking on, it would turn out to be a graphical Vooly editor.

I looked around if someone already had that idea (apparently not, which I think is interesting.) Essentially, what I wanted to do is tagging the OPML entries, and the OPML “specification” ([Winer rant suppressed]) even has the type= attribute that could be used for this (alternatively, I’d have added one).

Marked-up Outline: An outline which entries can be of different types and are displayed accordingly.

It’s a bit like that style selector known from popular word-processing (yuck) applications.

Given a marked-up outline, useful things can directly be made from it:

  • A XOXO-version (a.k.a., [Winer rant suppressed]) that has appropriate class= attributes and easily can be styled using CSS however you want.

  • A properly typeset version for printing, for example using ConTeXt’s XML facilities or some custom code to map the markup tags to TeX.

  • Filtered outlines, which only contain certain parts. This could be used to work around limitations of hierarchies.

  • and likely something nifty I didn’t think of…

Today, I decided to try implementing it, and dug into the OPML Editor.

This post was written using Emacs.

The display part of the OPML Editor is very hard to customize. Basically, the only thing that can be changed easily is the icon next to the entry, which is not enough for my purposes. If you have used the OPML Editor, you may have noticed it actually does style basic HTML (this was added in Frontier 7.0), for example it makes <b>foo</b> look bold. I thought I simply could add my own tags to that and only needed to figure out how to save the entry tags in the model.

The model part turned out easy, every node can have certain attributes that directly reflect the <outline> attributes of the corresponding OPML.

But it’s impossible to set the font size and style per-node, at least from UserTalk ([Winer rant suppressed]). The code that styles the basic HTML actually is written in C ([Winer rant suppressed]) and uncustomizable ([Winer rant suppressed]). Also, while searching for that code, I found some code I rather wish I hadn’t seen.

No go. I don’t want to hack C and build my own version of the OPML Editor just to make something like that possible.

I quickly looked into other means of editing outlines, especially browser-based ones. The ones I liked were the free sproutliner, Les Orchard’s experiments and the proprietary iJot. All of them are heavily JavaScript-based and I couldn’t figure out an easy way to extend them. If anyone wants to give that a try, by all means, do it!

For now, I’m deciding to go the “Unix way”. I’ll just add the entry tags directly into the outline entry (still need to figure a convenient syntax) and write some scripts to transform them to XOXO and TeX. Also, I may revive my ideas about an new Emacs mode, because with font-locking all that should be rather easy to do.

It’s a bit sad, I think quite a lot of people would have liked to have an easy program that can be used to create valid and semantic HTML documents based on some easy set of allowed elements…

NP: David Gilmour—Wish You Were Here

Read: Marking up outlines: Tagged OPML

Topic: Are you a Desiccant? Previous Topic   Next Topic Topic: Interesting discussion on Ruby books

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use