Feature Request External label resolution

Sherwood Botsford sgbotsford at gmail.com
Sun Apr 20 02:02:25 EDT 2008


Lou Quillio wrote:

>> Suppose that markdown was clever enough to reference an external

>> file (in .markdownrc of course) for the resolution of LABEL.

>>

>> NOW when I re-arrange the universe, I only have to change the reference in

>> this one file, NOT in every file that references it.

>

> Good idea to tokenize URL paths and what not, but it isn't Markdown's

> job to transform them for you ;). You'll want to pre-process those

> with your own script, then do your Markdown transforms.

>

>


Right now if I use the 'footnote' style of markdown link notation
I have to have the resolution of hte footnote in the same file.

What I'd like to do is consolidate all those resolution lines in
a single file.


Lets suppose that my tree farm inventory page lists 6 kinds of
spruce available in 4 sizes each. Every time that kind appears,
I want to have a pair of links that go to the spruce overview
page, and the species specific spruce page. Every time the size
appears, I want a link that goes to the price/quantity table for
that species.

Now elsewhere in the web page, in the advice page, I talk about
the formal look of Meyer's spruce versus the much more inforaml
look of Norway spruce. In each case I want Meyer's to show as a
link to the Meyer's spruce page, and Norway to point to the
Norway spruce page.

In my blog I may talk about how cute this year's Meyers' (Link
again) spruce are...

The Meyer's spruce page may have 40 links to it from other pages
in my web site. In turn that page may have many links from it to
articles. E.g: Care and feeding of spruce in general. A
comparison of the different spruces. Spruce vs Pine vs Fir,

If I move a link target I have to edit 50 files.
I don't want to edit 50 files for non-visible changes.
I want a system where Markdown sees the link label, and goes
to a single source, no matter what page called it to resolve
that label into a URL

Maybe it isn't markdown's place to do this.

And sure, I could write a perl script that would do this, but it
seemed to me that it was something that markdown *could* do.
And if it make life generally easier for Markdown users, it may
be a valuable enhancement.

To make that perl script robust, I have to maintain yet another
tree of files. The tt2 files, the markdown post process files,
and the final web site files. (If I used the perl script to
replace the token in place in the tt2 files, then I couldn't
change it later. If I wanted markdown to ignore the links, then
I'd have to invent a separate marking system, and process it
after markdown finished with it. This saves the extra file tree,
but it means I have to duplicate a significant fraction of the
parsing functions of markdown.

Don't get me wrong. I'm not desparate for this at this time.
But I hear rumours of a new version of markdown in the pipe.
This seems to me to be worth considering.


More information about the Markdown-Discuss mailing list