Re: Revisiting mime-types and file extensions

2007-06-21 Thread Michel Fortin

Le 2007-06-21 à 12:35, Phil Mocek a écrit :


Can anyone confirm that having the HTML fragment identifier
formatted as Thomas proposes is valid?  Both this [W3C design
issue paper][1] and [Wikipedia article][2] suggest otherwise, but
I'm not sufficiently familiar with this to say for certain.

[1]: 
[2]: 


The content for the id attribute for HTML 4 must obey [this rule][3]:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be  
followed by any number of letters, digits ([0-9]), hyphens ("-"),  
underscores ("_"), colons (":"), and periods (".").


[3]: http://www.w3.org/TR/html401/types.html#type-name


For XML, and by extension XHTML, it must obey the Name construct,  
which is defined as such [in the spec][4]:


NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |  
CombiningChar | Extender

Name ::= (Letter | '_' | ':') (NameChar)*

[4]: http://www.w3.org/TR/REC-xml/#NT-Name


Basically, HTML and XML both disallow digits as the first character  
of the id attribute. That's why the version number is preceded with a  
"v" in my profile page.


While invalid as an XML or HTML id value, a fragment identifier  
starting with a digit is still perfectly correct in a URL. Here's the  
definition of URL fragment according to [RFC 3986][5]:


fragment= *( pchar / "/" / "?" )
pchar   = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="

[5]: http://tools.ietf.org/html/rfc3986


Michel Fortin
[EMAIL PROTECTED]
http://www.michelf.com/


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


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Michel Fortin

Le 2007-06-21 à 9:45, Thomas Nichols a écrit :

This would allow us to chop the fragment identifier --  
'#major.minor' --

from the end of a profile, and match it against
/\#(|v|ver)\d+\.\d+$/
or similar.


I thought you needed an opaque URL to identify a specific version...   
treating URLs as anything else than an opaque string or a location  
reference, by inferring extra information from it, isn't a very good  
idea in my opinion. I'd use a separate version argument on the MIME  
type if I were you, because it doesn't force anyone to follow your  
own rules when crafting their URLs.



I'm assuming that version IDs will have a standard  
major.minor.bugfix format and that we can disregard the third  
element as irrelevant to the specification.


I think you've just made two big and possibly flawed assumptions.  
Just have to look at the changes for Markdown 1.0.1 and it's easy to  
spot a few important ones, like these two:



+   Changed the syntax rules for code blocks and spans. Previously,
backslash escapes for special Markdown characters were processed
everywhere other than within inline HTML tags. Now, the contents
of code blocks and spans are no longer processed for backslash
escapes. This means that code blocks and spans are now treated
literally, with no special rules to worry about regarding
backslashes.

**NOTE**: This changes the syntax from all previous versions of
Markdown. Code blocks and spans involving backslash characters
will now generate different output than before.

+   Tweaked the rules for link definitions so that they must occur
within three spaces of the left margin. Thus if you indent a link
definition by four spaces or a tab, it will now be a code block.

   [a]: /url/  "Indented 3 spaces, this is a link def"

[b]: /url/  "Indented 4 spaces, this is a code block"

**IMPORTANT**: This may affect existing Markdown content if it
contains link definitions indented by 4 or more spaces.


These are two big changes for a x.x.1 release.


Michel Fortin
[EMAIL PROTECTED]
http://www.michelf.com/


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


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Thomas Nichols


Phil Mocek wrote:
> On Thu, Jun 21, 2007 at 02:45:08PM +0100, Thomas Nichols wrote:
>   
>> Ok -- so your primary profile would be
>>
>> http://maruku.org/syntax/
>>
>> and the current spec would have a profile of
>>
>> http://maruku.org/syntax/#0.5
>>
>> is that correct?
>>
>> This would allow us to chop the fragment identifier --
>> '#major.minor' -- from the end of a profile, and match it
>> against
>>
>> /\#(|v|ver)\d+\.\d+$/
>>
>> or similar.
>> 
> [snip]
>   
>> If we ever got energetic enough to implement all of this, we
>> could then create documents and mark them with mime-type of
>> text/x-markdown;profile=http://maruku.org/syntax/#0.5
>> 
>
> Can anyone confirm that having the HTML fragment identifier
> formatted as Thomas proposes is valid?  Both this [W3C design
> issue paper][1] and [Wikipedia article][2] suggest otherwise, but
> I'm not sufficiently familiar with this to say for certain.
>
> [1]: 
> [2]: 
>
>   

I'm not sure whether [1] implies that "1.0" is an invalid fragment for
HTML documents, for example:   
"For HTML, the fragment ID is an SGML ID of an element within the HTML
object. For XML, if it is just a word, then it is the XML ID of an
element in the document"

Since an XML fragment could contain any valid XPointer expression, I
don't think there'd be any problem with "1.0" - and [RFC3986] reads:

"The semantics of a fragment identifier are defined by the set of
representations that might result from a retrieval action on the primary
resource.  The fragment's format and resolution is therefore dependent
on the media type [RFC2046] of a potentially retrieved representation,
even though such a retrieval is only performed if the URI is
dereferenced.  If no such representation exists, then the semantics of
the fragment are considered unknown and are effectively unconstrained. "

I just noticed the syntax of the URI for this RFC (see below) -- does
that look conclusive?

Best regards,
Thomas.

[RFC3986]: http://tools.ietf.org/html/rfc3986#section-3.5

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


revisiting the user-base

2007-06-21 Thread Bowerbird
thomas said:
>whether the user should be warned that 
>   she needs to 'sudo gem install maruku'
>   or perhaps 'sudo gem update maruku'

i presume these users of yours are _not_ mac users.  ;+)

-bowerbird

p.s.   isn't the chief appeal of markdown its _simplicity_?



**
 See what's free at http://www.aol.com.
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Phil Mocek
On Thu, Jun 21, 2007 at 02:45:08PM +0100, Thomas Nichols wrote:
> Ok -- so your primary profile would be
>
> http://maruku.org/syntax/
>
> and the current spec would have a profile of
>
> http://maruku.org/syntax/#0.5
>
> is that correct?
> 
> This would allow us to chop the fragment identifier --
> '#major.minor' -- from the end of a profile, and match it
> against
>
> /\#(|v|ver)\d+\.\d+$/
>
> or similar.
[snip]
> 
> If we ever got energetic enough to implement all of this, we
> could then create documents and mark them with mime-type of
> text/x-markdown;profile=http://maruku.org/syntax/#0.5

Can anyone confirm that having the HTML fragment identifier
formatted as Thomas proposes is valid?  Both this [W3C design
issue paper][1] and [Wikipedia article][2] suggest otherwise, but
I'm not sufficiently familiar with this to say for certain.

[1]: 
[2]: 

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


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Thomas Nichols


Andrea Censi wrote:
>> Excellent, thank you very much; using fragment identifiers for versions
>> works for me.  Andrea, would you be happy with
>> http://maruku.org/syntax
>> http://maruku.org/syntax#0.5
>> as profiles?
>
> OK for me.
>
> It's better with a final slash:
>
>http://maruku.org/syntax/#ver
>
> so that it's easier to serve a document (rubyforge.org does not
> support multiviews).
>

Ok -- so your primary profile would be
http://maruku.org/syntax/
and the current spec would have a profile of
http://maruku.org/syntax/#0.5
is that correct?

This would allow us to chop the fragment identifier -- '#major.minor' --
from the end of a profile, and match it against
/\#(|v|ver)\d+\.\d+$/
or similar. As a Ruby regex (I don't know Perl/PHP regex, it might
differ) this should I think give $2 as major and $3 as minor version for
the URIs we've discussed here. I'm assuming that version IDs will have a
standard major.minor.bugfix format and that we can disregard the third
element as irrelevant to the specification.

If we ever got energetic enough to implement all of this, we could then
create documents and mark them with mime-type of
text/x-markdown;profile=http://maruku.org/syntax/#0.5
and then when we later come to render them (perhaps on a different
system if the database has been dumped and reloaded) we'd be able to
decide whether this document can be safely rendered, or whether the user
should be warned that she needs to 'sudo gem install maruku' or perhaps
'sudo gem update maruku'. We could also allow her to specify 'vanilla
Markdown 1.0" as the syntax, in which case it could still be rendered on
systems which have only BlueCloth available.

This is enough for us to work with for now. For a 'standard' profile,
we'll be guided by John Gruber -- or if he has no objections, we'll use
http://daringfireball.net/projects/markdown/syntax
http://daringfireball.net/projects/markdown/syntax#1.0

Best regards,
Thomas.


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


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Andrea Censi

Excellent, thank you very much; using fragment identifiers for versions
works for me.  Andrea, would you be happy with
http://maruku.org/syntax
http://maruku.org/syntax#0.5
as profiles?


OK for me.

It's better with a final slash:

   http://maruku.org/syntax/#ver

so that it's easier to serve a document (rubyforge.org does not
support multiviews).


--
Andrea Censi
 "Life is too important to be taken seriously" (Oscar Wilde)
Web: http://www.dis.uniroma1.it/~censi
___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: Revisiting mime-types and file extensions

2007-06-21 Thread Thomas Nichols


Michel Fortin wrote:
> Le 2007-06-20 à 5:51, Thomas Nichols a écrit :
>
>> Having a mime type of 'text/x-markdown' and a profile URI
>> declared by the author of the language grammar (e.g.
>> "http://maruku.org/0.5";) seems an economical solution, and would follow
>> the pattern for [XML namespaces][xml-namespaces], Java JAXP feature
>> URIs[jaxp-features] and [OpenID identifiers][openid]
>
> All these need a unique identifier to work anywhere, ensuring that
> authors will create the unique identifier. Not the case with Markdown:
> anyone can create his own version without creating a corresponding
> unique identifier. If a downstream developer, someone else than the
> original author, needs an identifier and decide to create one, nothing
> ensure others will use the same identifier; and here goes the "unique"
> part of the identifier.

Yup, this is true - so maybe it would be good for the author of any new
Markdown-derivative syntax to  specify an identifying URI (as you have
done below)? It most certainly should not be the _document_ authors who
create such URIs, and if it is a downstream _processor_ author, for
example Andrea Censi with Maruku, then he could define a new URI - perhaps
http://maruku.org/syntax#0.5
 - and declare that it is a superset of the specs
http://michelf.com/ref/markdown-extra#v1.1
http://daringfireball.net/projects/markdown/syntax#1.0.1
(or whatever Mr Gruber would care to choose as a profile identifier).
>
> Beside, what does the identifier corresponds to anyway? A specific
> implementation? A particular syntax? One version of that
> implementation or that syntax or all of them? I can't really figure
> out right now: how many "unique" identifiers are needed and how are
> each going to be used?

A great reason for having formal language grammars! :-)

In the absence of such grammars, though, we have "the syntax supported
by Markdown.pl 1.01" or "the syntax as specified at
http://web.archive.org/web/20060530023711/http://daringfireball.net/projects/markdown/syntax
(in other words, John Gruber's syntax definition as at 30 May 2006). I'm
guessing that a new URI will typically be issued for a new version of a
spec, introducing features that are not handled (or - gasp - are handled
differently) in earlier versions.

As a CMS developer, when processing a document, I can examine the
mime-type (text/x-markdown) and look for a profile URI. I can then
select an appropriate processor for this profile, or warn the user if it
is not a profile that I recognize. All that is needed to get this to
work is for "downstream developers" of Markdown-derivative processors to
define their own URI and to declare which other  profiles are supported.
I'd guess that in order to be considered a Markdown processor at all,
John Gruber's original profile should always be supported.
>
>
>> Any suggested changes to this? Michel, would you care to propose a URI
>> for Markdown Extra, should anyone decide they'd like to use one?
>
> I'm still not sure using URLs for this is worthy, but if someone wants
> a reference URL for Markdown Extra, I'd suggest using this:
>
> http://michelf.com/ref/markdown-extra
>
> I've put a small explanatory document at this address. If you need
> versioning, here is what I suggest:
>
> http://michelf.com/ref/markdown-extra#v1.0
> http://michelf.com/ref/markdown-extra#v1.1
>
> These are the two points at which PHP Markdown Extra changed its
> syntax specification (besides beta versions) to accomodate new features.

Excellent, thank you very much; using fragment identifiers for versions
works for me.  Andrea, would you be happy with
http://maruku.org/syntax
http://maruku.org/syntax#0.5
as profiles? And John, as the instigator of this dance, would you care
to suggest a canonical profile URI? Or should it be just
http://daringfireball.net/projects/markdown/syntax
http://daringfireball.net/projects/markdown/syntax#1.0.1
?

As per the XML namespaces spec, we'll be relying upon exact string
matching to identify profiles.

Thanks to all who've worked on this.

Regards,
Thomas.

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