Attribute references

Lou Quillio public at quillio.com
Sun Jan 9 17:09:55 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michel Fortin wrote:
> Le 9 janv. 2005, à 13:19, John Gruber a écrit :
> 
>> One advantage of this is that for something like classes, you can
>> define one class attribute defintion, and reuse it on as many
>> elements as you need.
> 
> I see this as a reference to a reference.

Agree.  There's no advantage, and readability disadvantages.

>     ![image](sourceURL){#my-image .my-class width="30" height="30"}

A bit long, n'est-ce pas?  Still, it's very flexible, and images are a
special case:  there's no expectation that they're viewable in the
source.  And most often you'd do something like

    ![alt text](path/to/image){.right}

which is pretty clean.  But wait.  Who needs the special alt text syntax
when there's a general attribute syntax?

    !(path/to/image){.right alt="alt text"}

So if you go Michel's way, the possible refinements are confined to
providing a shorthand for the commonest, most valuable "discretionary"
attributes -- to avoid visual noise.  For images there are four:  alt,
class, width, height

    !(path/to/image){[alt text] 176/80 .right}

    <img src="path/to/image" alt="alt text" width="176" height="80"
class="right" />

That handles almost anything you'd want to do with an image, and is
consistent with proposed inline class and id syntax:

    This is a special paragraph. {.special}

The only difference is some special shorthand for the required alt
attribute and the desirable width and height attributes.

LQ
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4auzWb6NuB4EK7oRApr8AJ9gbN83AQj7Uqw8KitZHYhbcmIxegCeJg6Y
Y1hy8qByFHyHAuORS6UWgow=
=pIK9
-----END PGP SIGNATURE-----


More information about the Markdown-Discuss mailing list