`time` element syntax

Michel Fortin michel.fortin at michelf.com
Sun Jun 5 18:58:56 EDT 2011


Le 2011-06-05 à 18:23, David Chambers a écrit :


> Hi folks,

>

> Thanks for your input. I'm pleased to have raised this issue for discussion.

>

> [...]

>

> The problem with the approach suggested by Rob and Michel is that it works

> for only a subset of cases. A very large subset perhaps, but a subset

> nonetheless. The displayed text may be "Christmas Day" or "7pm tomorrow".

> While in many cases it may seem a violation of DRY to include both forms,

> it's clearly not possible to go translate from "human" to machine in all

> cases, nor is it necessarily possible to translate in the other direction.


If I put my mouse pointer over "7pm tomorrow" in your email, Apple Mail circles it with a dotted line with a popup menu offering to add a new event to my calendar. Clearly the algorithm can be quite clever. But you're right it will never catch all cases. But for the cases it won't catch, there's HTML.

I'm not saying it's the ideal solution.



> Heck, Waylan, you've done it again. This is extremely readable and allows

> the `pubdate` attribute to be included if desired.

>

> Some text [30 May 2011] more text.

>

> [30 May 2011]: datetime: 2011-05-30T15:00-07:00, pubdate

>

> would become…

>

> <time datetime="2011-05-30T15:00-07:00" pubdate="pubdate">30 May 2011

> </time>


I'd tend to go for something even simpler:

Some text 30 May 2011 more text.

*[30 May 2011]: 2011-05-30 15:00 -07:00

Basically, why do we need to force brackets in the text at all? Also, why force the writer to use 'T' as a time separator and strictly follow to the rules of HTML date syntax? It's much more readable without the 'T'. Reformatting it to HTML's liking should be pretty trivial.

Also, note that what I have proposed above is simply an extension to PHP Markdown Extra's abbreviation syntax. I'd propose that if the abbreviation looks like an ISO date/time, the Markdown parser would just emit a `<time>` or `<date>` element, whatever is most appropriate, instead of `<abbr>`. I'd rather not add a new Markdown syntax for each and every element in HTML.



> The resemblance to links is actually a *good* thing in my opinion. It allows

> readers to guess (correctly) that the there is accompanying data and that

> it likely resides after the current paragraph or at the end of the document.


I disagree. Someone reading the HTML output in the browser is unlikely to notice there's a date/time element here or there on the page with a computer-readable date. And even if you made date time elements flashing red, what would be the point?

It has some value if, like in Apple Mail, you can move your pointer to it and do some action. But that's not going to be true in the Markdown text version (unless it gets scanned for common date patterns like Mail does). So why again should the reader know there's a computer-readable version of the date somewhere further in the document?


--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the Markdown-Discuss mailing list