Describing Enclosures in HTML

Update

I've updated my thoughts on enclosures by writing a HTML Meta Profile For Blogs. There are two related blog entries:

For a couple of minutes this entry was called “Wordpress Sucks”. That's not fair, so I decided to change the title. Wordpress is the most interesting blogging system out there right now. That's where the innovation is happening. I just don't think what they've done here is a good idea.

I really like Wordpress, but when I read how Wordpress is handling enclosures I was disappointed. Wordpress looks for any links to an mp3 file in each entry and adds those to the RSS feed as enclosures. That's not a good way to do things. What happens when I link to someone else's Podcast? Their Podcast will be added to my feed as a part of my blog entry. That's one broken feed.

RSS is a syndication format. It represents content which exists elsewhere. Thus any changes must happen on the HTML-level and not in the feed. The feed must not contain any content that the HTML is represents does not contain. That's why you break RSS when you mindless add enclosures that may or may not be a part of the blog entry.

In addition you would have to wait for updates in your blogging system every time you wanted to include a new type of file. Right now Wordpress looks for mp3 files, but what about Quicktime video files, Windows Media audio. What about photoblogs who might want to add their photos as enclosures? Hell, what about Excel spreadsheets? We need a general way of describing links, not a patch solution like the one Wordpress has made.

I propose that blogging systems and websites start using the following HTML notations to help determine whether the content behind a link is to be seen as an integral part of a HTML document or not. I'm using <a>-elements below, but the same applies to <link>-elements. Examples are at the bottom of this entry.

<a href="[URL]">Link</a>

This is a normal link describing a reference to the linked resource. The URL the link points to should not be added as an enclosure since links by definition point to another resource.

<a href="[URL]" rel="alternate">Link</a>

The rel="alternate" is a part of the HTML specification:

Alternate. Designates substitute versions for the document in which the link occurs. When used together with the lang attribute, it implies a translated version of the document. When used together with the media attribute, it implies a version designed for a different medium (or media).

This type of link (along with a type attribute) designates that the content of URL pointed to can be substituted for the content of the HTML document. Ie. the URL can be understood without the context of the HTML document where the link resides. The URL linked should be added to the RSS feed as an enclosure.

<a href="[URL]" rel="enclosure">Link</a>

This is a new type of relation. It designates that the URL pointed to should be seen as a part of the HTML document, but not as a substitute for the HTML document. It compliments it rather than substitutes it. The linked URL should be added to the RSS feed as an enclosure Hints about content-type can be given with the type attribute).

Of course changes to the UI of blogging systems must be made. It is only the author of a given document who can make the distinction between the three different links. There is no way software can make the correct guess. The blogging system should provide some way for the author of an entry to mark links as belonging to one of these three categories. When creating links while authoring an entry it would be ideal if the blogging system at the same time as embedding the HTML code gave the author a choice as to what kind of link he is making.

If you want to use a profile attribute to show that you are using the enclosure as described here it should point to http://www.solitude.dk/archives/20041026-1300/

Examples

The following three paragraphs should be seen as examples of (short) blog posts. They have been created as to show the difference between the three different kinds of links.

<p>I was listening to Dave's <a href="http://static.scripting.com/blogs/gems/davetravel/cnOct24a.mp3">new Podcast</a> the other day. He has some good points in it.</p>

<p><a rel="alternate" href="http://www.solitude.dk/archives/files/podcast.mp3">My lastest video.</a> A short tour of my university campus.</p>

<p>I've been working on a new design for this website. I'm having some issues getting it to look right in Browser X. <a rel="enclosure" href="http://www.solitude.dk/archives/files/screenshot.png">Here is how it looks in Browser X</a>. Any help would be much appreciated.</p>

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.

Recent photos

About the blog

This is the personal website of Andreas Haugstrup Pedersen: commentary on media, communi­cation, culture and technology. Read more»