Markdown and Mathematics

Michel Fortin michel.fortin at michelf.com
Sun Apr 11 14:08:41 EDT 2004


Le 10 avr. 2004, à 18:49, John Gruber a écrit :

> Michel Fortin <michel.fortin at michelf.com> wrote on 04/07/04 at 8:38p:
>
>> Jelks Cabaniss wrote:
>>
>>> Whatever they end up being, you'll probably want to include the
>>> "notation"
>>> along with the delimiters, something like
>>>
>>>     {$mathml: ... Math expression ... $}
>>>     {$latex:  ... line noise ... $}
>>
>> I like that idea. It is also my opinion that it's important to include
>> extension's name in the syntax, or otherwise there will be conflict 
>> the
>> minute someone want to use more than one extension.
>
> But I don't think Markdown itself should look for or do anything
> with the names of these additions. All I want to do at this moment
> is decide on a set of delimiters which Markdown will not process the
> contents thereof.

You are right. I'm not saying Markdown should do anything with this 
currently, but the idea was to set a recommendation for extension 
makers so that they do not enter in conflict each other, or with a 
hypothetical future release of Markdown with plugin support.

Maybe this is not needed after all.

>> But there is another potential problem: what if someone write this in 
>> a
>> code block?
>
> Yeah, that's a tricky question. But I don't think it's up to
> Markdown itself to decide.

My point was only to show that each extension would have to duplicate 
current Markdown tokenization as an introduction to the plugin idea.

>> Or maybe Markdown could accept *plugins*. That means you put the
>> plugins in a special directory. When parsing, if Markdown encounter a
>> `{$latex: ...$}` block, it looks for a file named "latex" in that
>> directory and process the output using that program. If the plugin is
>> not found, Markdown removes the delimiters and leave only the content.
>
> Whoa, slow down.  :^)

I was just thinking out loud. ;-) I understand things must not be 
rushed.

> It's possible, at some later date, that we can do this. And we can
> do it without breaking 1.0 syntax if we pick good delimiters now.
>
> I'm just not sure what those delimiters should be.
>
> {$...$} isn't too bad. But it's sort of hard to type.
>
> {{...}} is easier to type.

I think I prefer {{this one}}.

Another syntax that could be post-processed and would already work is 
this:

	<?math ... ?>

It's a processor instruction in the XML specification. An advantage of 
it is that in code blocks `<>` characters are encoded and the 
postprocessor will ignore them for free. Great! A downside may be that 
if not processed a well behaved browser will not display it's content 
(but the XML would stay valid). The other downside is that it's harder 
to type than `{{...}}`. Also to note: writing `?>` inside is 
prohibited.

Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/


More information about the Markdown-discuss mailing list