Re: `time` element syntax

2011-06-02 Thread Michel Fortin
Le 2011-06-02 à 5:08, David Chambers a écrit :

> Hi folks,
> 
> I expect that the response to this post will be "we don't need such a
> thing", but humour me for a moment by pretending that in fact we do.
> 
> HTML5 added a number of new tags to the mix, but arguably the most
> significant is the `time` element. It associates a machine-readable
> timestamp with a human-readable string (e.g. ` datetime="2011-05-30T15:00-07:00">30 May 2011`).
> 
> I would love to be able to write something like `[30 May
> 2011]{2011-05-30T15:00-07:00}`.
> 
> `/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(?:[.](\d+))?)?([-+]\d\d:\d\d|Z)$/`
> could be used to ensure that only valid `datetime` attribute values are
> matched. This would avoid false positives and would keep `[foo]{bar}`
> available for other functions, potentially.
> 
> Are there any reasons not to use `[human]{computer}`? Can anyone suggest a
> better syntax?

Personally, I think if you're going to write a lot of dates like this the best 
syntax would be to auto-detect "30 May 2011" as a date. But this might need to 
be done at another layer than Markdown since Markdown doesn't know about your 
time zone and the date format might depend on your language and locale.

-- 
Michel Fortin
michel.for...@michelf.com
http://michelf.com/



___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: `time` element syntax

2011-06-02 Thread Rob McBroom
On Jun 2, 2011, at 5:08 AM, David Chambers wrote:

> I would love to be able to write something like `[30 May 
> 2011]{2011-05-30T15:00-07:00}`.


I don’t have any strong feelings about syntax, but manually entering the date 
in two formats doesn’t seem very DRY. I’d prefer to just type one (probably the 
machine-readable one, as it contains the time) and let the toasters do the work 
of generating the other.

-- 
Rob McBroom


___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: `time` element syntax

2011-06-02 Thread David Parsons


On Jun 2, 2011, at 2:08 AM, David Chambers wrote:


Hi folks,

I expect that the response to this post will be "we don't need such  
a thing", but humour me for a moment by pretending that in fact we do.


HTML5 added a number of new tags to the mix, but arguably the most  
significant is the `time` element. It associates a machine-readable  
timestamp with a human-readable string (e.g. `datetime="2011-05-30T15:00-07:00">30 May 2011`).


I would love to be able to write something like `[30 May 2011] 
{2011-05-30T15:00-07:00}`.


 That looks like it would be a good place for a pseudo-protocol:

[two days ago](time:2011-05-30T15:00-07:00 "May 30th, if you care")

 This would have the advantage of being fairly unambiguous, instead
of superimposing a magic time string over the existing linkyformat.


-david parsons
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: `time` element syntax

2011-06-02 Thread Waylan Limberg
Interesting suggestion David. Although, you're right, I'm not sure
what real value this serves. Why can't we just use raw html here?

That said, there certainly is no reason why this couldn't be an
unofficial addon - in which case you would want to do it right. So
here are some thoughts on your suggested implementation:

On Thu, Jun 2, 2011 at 5:08 AM, David Chambers
 wrote:
> `/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(?:[.](\d+))?)?([-+]\d\d:\d\d|Z)$/`
> could be used to ensure that only valid `datetime` attribute values are
> matched.

Ok, this looks like it would match a valid date and time [1], but what
about a date without time or a time without date [2]? According to the
spec, all three should be allowed [3]. Have fun building that regex.
:-)

> This would avoid false positives and would keep `[foo]{bar}`
> available for other functions, potentially.

I understand what you're trying to do here, but I suspect this could
conflict with the attribute list syntax used by a few
implementations.[4] I realize they start with a colon `{: ...}`, but
the similarity should at least be considered.

Another concern it that `[foo]{bar}` looks an awful lot like
`[foo](bar)` or even `[foo][bar]`. I realize the later two look very
similar, but as both indicate links, there is less for the reader to
get confused about. You're introducing a non-link syntax, so it should
probably look less like a link IMO.

That said, I'm going to ignore the 'looks like a link' issue for a
moment and add that I think I would prefer something like a reference
syntax with a datetime label:

Some text [30 May 2011] more text.

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

The text is easier to read here, which actually provides a benefit
over just entering the raw html. Of course `[30 May 2011][]` or `[30
May 2011][some label]` could also work, although I don't know why
you'd want to use them.

Now if you can come up with a clean way to make that look less like a
link, I might be interested in using it myself. Otherwise, I'll stick
to raw html here.

[1]: 
http://dev.w3.org/html5/spec/common-microsyntaxes.html#global-dates-and-times
[2]: 
http://dev.w3.org/html5/spec/common-microsyntaxes.html#valid-date-or-time-string
[3]: http://dev.w3.org/html5/spec/text-level-semantics.html#the-time-element
[4]: http://maruku.rubyforge.org/proposal.html#attribute_lists

-- 

\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


`time` element syntax

2011-06-02 Thread David Chambers
Hi folks,

I expect that the response to this post will be "we don't need such a
thing", but humour me for a moment by pretending that in fact we do.

HTML5 added a number of new tags to the mix, but arguably the most
significant is the `time` element. It associates a machine-readable
timestamp with a human-readable string (e.g. `30 May 2011`).

I would love to be able to write something like `[30 May
2011]{2011-05-30T15:00-07:00}`.

`/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(?:[.](\d+))?)?([-+]\d\d:\d\d|Z)$/`
could be used to ensure that only valid `datetime` attribute values are
matched. This would avoid false positives and would keep `[foo]{bar}`
available for other functions, potentially.

Are there any reasons not to use `[human]{computer}`? Can anyone suggest a
better syntax?

David
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss