[uf-new] rel-code

Toby A Inkster mail at tobyinkster.co.uk
Wed Jan 14 14:18:50 PST 2009

Jamie Rumbelow wrote:

> By adding rel="code" to a hyperlink, a page indicates that the  
> destination
> of the hyperlink contains a source code file. By adding a
> lang="whatever-programming-language" attribute, the document can  
> specify
> what programming language the destination contains.

The HTML 4.01 recommendation defines the lang attribute as being an  
RFC 1766 code. (RFC 1766 has since been obsoleted by RFC 3066, itself  
obsoleted by RFC 4646/4647, so one assumes that authors should now  
use RFC 4646/4647 codes instead.) Putting a programming language in  
there is against the spirit of the spec, and (although SGML  
validators won't spot it) against the defined syntax.

HTML already contains a perfectly good way of indicating that a  
linked file is in a particular programming language - the type  

<a href="foo.pl" type="application/x-perl">Foo (download script)</a>

Toby A Inkster
<mailto:mail at tobyinkster.co.uk>

More information about the microformats-new mailing list