[kramdown-users] Syntax of IALs, ALDs and extensions

Thomas Leitner t_leitner at gmx.at
Tue Apr 20 03:37:58 EDT 2010


> >    Extension without body:
> >        {:options>  key="val"}
> 
> The mnemonic significance to the ">" is not entirely obvious other
> than ">" being a closing symbol of XML/HTML tokens. My personal
> aesthetic reaction also is that it also looks rather ugly.  Some
> other possibilities, including mnemonic hints:
> 
>      {:options/ key="val"}  hint: XML/HTML
>      {:options$ key="val"}  hint: regular expressions
>      {:options. key="val"}  hint: written language
>      {:options! key="val"}  hint: emphatic "that's all!"
>      {:/options key="val"}  hint: XML/HTML

I agree that `>` is not perfect for the job.
 
> The last example could potentially be confused as a closing tag (if
> you go that route), thus probably would not be wise. Shawn's proposal
> of "{:options ... /}" also had merit in the spirit of XML/HTML,
> although I understand that you prefer to have such tokens at the
> start rather than end of the sequence. (Perhaps you could clarify the
> reasoning behind this.) If tokens at the end of sequence were
> allowed, then another possibility would be:
> 
>      {:options key="val":}  hint: symmetry of {: and :}

One reason why I would like to have the token at the start is that it
is easier to parse and when you encounter such a tag you immediately
know that it contains no body. However, this should not hinder us - I'm
perfectly willing to put a token at the end!

Regarding the colon as the token: Although the symmetry seems nice, I
fear that the colon can be overlooked to easily. Therefore I would
rather go with a slash instead of a colon, also keeping in mind Shawn's
proposal and the similarity to XML/XHTML.

> > Removing the leading colon/making it optional?
> > I said in another mail that I don't want to remove the leading
> > colon in IALs/ALDs/extension because it makes it easy to remove the
> > special kramdown tags to get more valid Markdown text. I was
> > thinking about this and how often braces are used in normal text...
> > If they are rarely used, we could probably remove the leading colon
> > and get a more concise syntax - what do you think about this?
> 
> The conservative in me feels uncomfortable with the idea of removing
> or making optional the leading colon. The sequence "{:" is
> sufficiently uncommon in text that I don't worry about conflicts, but
> opening with a bare "{" seems too dangerous.

Okay, that's good to hear :-) I kinda feel the same - I was just
throwing it in because we were already talking about syntax changes. So
we will have the leading colon in IALs/ALDs/extension.

> > Maruku currently only needs the leading colon with ALDs but not with
> > IALs where it is optional. Iff we remove the leading colon, we would
> > make the syntax incompatible with Marukus...
> 
> Is it documented anywhere that the leading colon is optional in
> Maruku IALs? I never knew this until you mentioned it and I tested it
> for myself. Every example on the Maruku site includes the colon. In
> any event, unnecessarily breaking compatibility with Maruku (or other 
> Markdown processors) seems like a bad idea.

I don't think that it is documented anywhere, I found it while looking
through Maruku's sources. Since the leading colon will stay, there is
also no problem with compatibility.

-- Thomas


More information about the kramdown-users mailing list