Proposal: Markdown, plugged in

Rad Geek technophilia at radgeek.com
Thu May 20 14:51:57 EDT 2004


On Sun, 16 May 2004 16:14:52 -0400, Michel Fortin  
<michel.fortin at michelf.com> wrote:

> Hum, that concept is great, but I'm not so sure you took the right  
> approach to the problem. I'm taking as an example your wikipedia plugin.

Thanks, Michel, for your kind words about the concept and your  
constructive feedback about the implementation. I am going to bypass the  
first problem (whether changing link text is in the spirit of Markdown  
link syntax or not), because I don't have any strong opinions on the  
matter. I debated over whether or not to hack in support for changing the  
link text and decided to err on the side of inclusion rather than  
exclusion; the main reason for this is that it allows a reference plugin  
to do something like the way that WikiPedia handles a "null pipe", such as  
this:

     [[WikiPedia:Markup (computer programming)|]]

which WikiPedia will render as:

     <a href="...">Markup</a>

Of course, Markdown is *not* MediaWiki, and if letting plugin functions  
munge the link text is too un-Markdownish then it will be easy enough to  
remove that aspect of the plugin interface with Markdown.

The second question that Michel raises is the one that I want to deal more  
directly with, since it is a more fundamental one. That is: should  
something like this be (1) shoehorned into the reference syntax, and (2) a  
part of Markdown *at all*?

> Now with the second problem. I think you are making a mistake by using  
> the reference syntax for this. Let's say I want to write a link to  
> wikipedia inside my text. Here is what I would expect to be able to do:

> 	This is a small paragraph with a [link to a normal url][1] and another
> 	[link to a Wikipedia page][2].

> 	[1]: http://www.michelf.com/
> 	[2]: Wikipedia:Markup

> But that's not quite possible if you are using the reference syntax like  
> you do currently. Predefined references (bookmarks) may be a good idea,  
> but Wikipedia references are more like a shortened url than a reference.

This is certainly a sensible reaction--but I'm not sure it's mine.  
Certainly it makes *sense* to conceptually treat InterWiki links as an  
extension of the URI concept rather than as an extension of the Markdown  
reference concept. But I think it *also* makes perfect sense to treat them  
as a sort of "smart reference". You might think of it a bit like another  
form of reference--inline citations in print to canonical texts:

     There is "a time to rend, and a time to sew" (Ecclesiastes 3:7).

Now, in *some* sense, you might say that "Ecclesiastes 3:7" is a short  
"address" for the chunk of text. But you might just as easily think of it  
as a *reference*: inline citations that look just like this are used in  
texts that refer to explicit bibliographic tables elsewhere in the text.  
The cite here does not because the text is so widely known and so widely  
available that an explicit "address" is just not necessary. And you might  
think that InterWiki mappings serve the same function. This speaks, if  
anything, to something of a slippery slope between what counts as a  
"reference" and what counts as an "address" in the first place...

(How do the Wikis themselves treat it? Well, this depends a bit on the  
Wiki syntax. WikiPedia, for example, makes a syntactic distinction between  
URIs and intra-Wiki/inter-Wiki links:  
[http://www.wikipedia.org/w/Markup_(computer_programming)] vs.  
[[WikiPedia:Markup (computer programming)]]. Other Wikis use a single  
free-linking syntax for both URIs and Wiki links (e.g. a single set of  
square braces for both).)

But one advantage of the plugin approach is, of course, that it lets you  
*choose* where in the fuzzy middle region that line should be drawn. If  
InterWiki referencing doesn't make sense to you, then of course you don't  
have to use it. (I would say, though, that the piddling syntactic details  
are enough to make it worth *my* while, at least, to include it: I want to  
be able to refer to "WikiPedia:Markup (computer programming)" from within  
Markdown syntax, and if the (flexible) reference pattern is an easier fit  
than the (relatively inflexible) URI pattern, well, I'll take the former.)  
In any case, here are a couple other potential applications that fit quite  
cleanly within the conceptual sphere of Markdown references:

1.  As you say, predefined references ("bookmarks") seem to be a  
reasonable extension
     of Markdown references--and one that it potentially very useful,  
especially since
     one of the main applications of Markdown is blogging. This lets  
webloggers be lazy
     about certain trivial things; and that's a good thing.

2.  Another application that seems quite reasonable, to me at least, is  
for references
     that are generated *from other references*. I demonstrated a very  
crude version of
     this on the Dingus in the "Source function" plugin:

         Here is an [article on something][1] that was printed in today's
         [Podunk Times-Picayune][source:1]

     Now, "the source of 1" has no meaning at all outside of Markdown; [1]  
is a
     reference within Markdown. One could imagine other applications--say,
     [Technorati:1] to get discussion of [1] on weblogs, or any number of  
more fanciful
     applications.... The point here is that this again makes our lives  
easier--in this
     case because it lets us generate more than one URI from the  
information typed out
     in a single reference. As before, it lets us be lazy. And it lets us  
be lazy at no
     cost to those who don't want to be lazy in this particular way. And I  
don't *think*
     it makes hash out of the syntax. So again, a good thing to have around.

But the reason I want to urge the plugin approach in particular is that  
there's no good way to generalize these features for all the environments  
into which Markdown might be dropped. Markdown shouldn't *have* to know  
about these things; it's sufficient to make it trivial for someone to hack  
together a bit of code that does the work *for* Markdown in a particular  
environment. That's the main thing I want to urge--not some particular  
implicit referencing plugin or another.

The general principle is: for a variety of reasons (not just InterWiki  
links, but also different ways of implementing predefined  
references/"bookmarks", functions based on explicit Markdown references,  
...), Markdown should support implicit references. But there's no good way  
for Markdown to know what to make of implicit references. So, instead,  
let's define a simple hook for Markdown to pass the buck back to the  
module that should know: the content management environment into which  
Markdown has been dropped. The plugin interface is a simple way to do  
that. So something like the plugin interface should be incorporated into  
Markdown.

What do y'all think?

-C

[... snipped: a good discussion of the benefits and limitations of  
implementing InterWiki linking through another processor that chews  
href="..." attributes. Very good thoughts about a way to do it if it is  
not implemented from within Markdown ...]

-- 
Charles Johnson <technophilia at radgeek.com>
AIM: AiPuch
WWW: http://www.radgeek.com/

Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


More information about the Markdown-discuss mailing list