thoughts on predefining links
John Gruber
gruber at fedora.net
Sat Mar 13 00:08:07 EST 2004
Jason Clark <jason at jclark.org> wrote on 03/10/04 at 5:10p:
> One of the things I'd like to do with Markdown on my Blosxom blog is to
> maintain a list of common link references as a standalone file, and
> have that file always be referenced. For example, I'd like to have a
> "links.txt" file that looks like:
>
> [markdown]: http://daringfireball.net/projects/markdown "The Markdown
> Project Home Page"
> [blosxom]: http://blosxom.com
> [del]: http://del.ico.us/jason
> ....
That's a fine idea. But.
> These would be links I tend to refer to very often. I am nothing if
> not lazy.
Indeed, laziness is a virtue:
<http://c2.com/cgi/wiki?LazinessImpatienceHubris>
> There are two ways I can go here - Blosxom-specific or
> Markdown-specific. On the blosxom side, I can use the include plugin
> (or similar mechanism) to read the file and include it in every story,
> prior to Markdown running as a blosxom plugin. The downside here is
> that the list of links get processed for every story. In my default
> view, there are 10 stories on a page.
I'm not familiar with the way the Blosxom Include plug-in works, but
my guess is that this wouldn't incur much overhead at all, unless
your shortcut file was ridiculously large. I mean like really,
really huge. Apache's server side includes, as well as PHP's, for
example, are, for the purposes of all but the highest-traffic web
sites, instantaneous.
> Before I proceed, just thought I'd see if there's any interest in
> making this more general pupose. I intend to offer a patch with my
> changes for those who wish to use them, but If there's already a plan
> for similar functionality (or an interest) I'd rather write it to fit
> the plan the first time.
The problem I see with generalizing this is that I don't see how you
could generalize the storage and location of the shortcut file.
Right now, Markdown.pl is just one file -- no config files, and no
dependencies on Perl modules that don't ship with the standard Perl
library.
I mean, you're certainly welcome to modify Markdown.pl to do this if
you want, but to me it seems much cleaner to use some other method
of including a list of standard shortcuts. In other words, let
Markdown just be Markdown: plain text in, HTML out. Nothing else.
But I really do think it's a good idea, so no matter how you
implement, I'd like to hear about how, and I hope you write it up.
--
John Gruber | Daring Fireball
gruber at fedora.net | http://daringfireball.net
More information about the Markdown-discuss
mailing list