Attribute references

european bob bob at wolfwall.com
Sun Jan 9 16:40:51 EST 2005


On Sun, 2005-01-09 at 16:19 -0500, Michel Fortin wrote:
> I think it's a lot better this way:
> 
> 	## My Intriguing Header ## {id="intrigue"}
> 
> 	This is a link to [my intriguing header](#intrigue).
> 
> Or this way:
> 
> 	## My Intriguing Header ## {#intrigue}
> 
> 	This is a link to [my intriguing header](#intrigue).


Actually, I don't like either of those :) If you're going to link using
this references, they should turn into internal anchors - which are not
tag ids. 

I'm not sure John was suggesting using this to be able to setup internal
links, but it would be nice in a way I think. It feels a little bit
dodgy though.

> If you don't mind, my proposition for a syntax would be like this. In 
> the curly brackets, I would allow a list of attributes, ids identified 
> by a leading hash (`#`), and classes identified by a leading dot (`.`). 
> So this thing:
> 
> 	![image](sourceURL){#my-image .my-class width="30" height="30"}

Given Markdown is supposed to be a natural markup (e.g, the reader would
understand it), I'm kind of predisposed to not like that markup - but
then, you've always been able to include raw HTML.

Being able to assign class seems somewhat useful, id somewhat less so.
Both have problems - classes are specific to sites, not documents, and
without a stylesheet are pretty meaningless (and don't necessarily add
anything - e.g., some consistently using a class within a set of
documents is almost certainly doing it wrong). Generating IDs is also a
bit dubious, since Markdown is often used to generate fragments, not
whole documents, and has the same objections as classes. 

It *feels* like a lot of work for not much real gain; and the more I
think about it, the more warty it feels. It makes things feel more
ambiguous. Being able to give something an ID, for examples, feels
useful - but probably shouldn't be done in a generic manner, since it
would also be useful for internal links (and thus would generate
different markup in different contexts). Classes also feel useful, but
again, could have specific Markdown use as well as HTML (they feel a bit
macro-y). Having syntax to add various other attributes feels like a
different kettle of fish.

--bob.



More information about the Markdown-Discuss mailing list