rel="source"

Aral and his trusty sidekick Victor have taken up residency for a while at the Clearleft office in Middle Street while they work on their very exciting project. It’s nice having them around.

I got chatting to Aral about a markup pattern that’s become fairly prevalent since the rise of Github: linking to the source code for a website or project. You know, like when you see “fork me on Github” links.

We were talking about how it would be nice to have some machine-readable way of explicitly marking up those kind of links, whether they’re in the head of the document, or visible in the body. Sounds like a job for the rel attribute, I thought.

The rel attribute describes the relationship of the current document to the linked document. You can use it on the link element (in the head of your document) and the a element (in the body). The example that everyone is familiar with is rel=”stylesheet” when linking off to a CSS file—the linked document has the relationship of being a stylesheet for the current document.

The rel attribute could theoretically take a space-separated list of any values, just like the class attribute. In practice, there’s much more value in having everyone agree on which rel values should be used.

There used to be a page on the WHATWG site for listing rel values, but it tended to stagnate. So now the official registry for rel values is on the microformats wiki. That’s where you can see which values are recommended for use today and you can also brainstorm new ideas.

The benefit of having one centralised for this is that you can see if someone else has had the same idea as you. Then you can come to agreement on which value to use, so that everyone’s using the same vocabulary instead of just making stuff up.

It doesn’t look like there’s an existing value for the use case of linking to a document’s (or a project’s) source code so I’ve proposed rel=”source”.

Now I should document some use cases of people linking their site to its source code. It might be that wikis qualify as another use case: every “edit” button points to the source of the document in wiki markup.

If you have any thoughts on this pattern, or examples to add, please feel free to add them.

Have you published a response to this? :

Responses

thechangelog.com

Proposed Microformat for site’s source code, rel=“source”

 How awesome would it be to use rel="source" to link a document or project to it’s source code?

From Jeremy’s post:

We were talking about how it would be nice to have some machine-readable way of explicitly marking up those kind of links, whether they’re in the head of the document, or visible in the body. A rel attribute describes the relationship of the current document to the linked document. So I’ve proposed rel=”source”.

If you agree with Jeremy share his post and help spread the word. Have comments? Send a tweet to @TheChangelog on Twitter.Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.

 Linked by Adam Stacoviak on Feb 19, 2014 Links Microformats Open Graph Open Source

# Wednesday, February 19th, 2014 at 9:29pm

Previously on this day

12 years ago I wrote Foo fighting

Kung-Foo fighting. It was a little bit frightening.

13 years ago I wrote Fun with type

Juvenile high-jinks in the Clearleft office.

15 years ago I wrote Breaking news

Last year, the New York Times ran a story about the iPod’s shuffle feature. "Is it really random?", they wondered.

16 years ago I wrote As the web turns

I’m back from Ireland where I had an enjoyable, if somewhat rushed, weekend of seafood, stout and song.

17 years ago I wrote Photoshop Funny

What really happened to the West Pier.

17 years ago I wrote Pattern Recognition

A new book by William Gibson is always a cause for celebration. I’ll grab myself a copy as soon as I’m done with Cryptonomicon.

17 years ago I wrote London kills me

Jessica is very kindly treating me to a day of music in London.

18 years ago I wrote The bleat, the pretzel and the president

One of my all-time favourite websites is lileks.com, home to The Institute Of Official Cheer featuring The Gallery Of Regrettable Food, probably the funniest thing I have ever read on or off the web.

18 years ago I wrote On the Internet, Nobody Knows You're a Dog

Jessica has one of those calendars filled with cartoons from The New Yorker.