[kramdown-users] Syntax of IALs, ALDs and extensions
Eric Sunshine
sunshine at sunshineco.com
Mon Apr 19 15:37:28 EDT 2010
Hi Thomas,
I was going to wait until Shawn posted since he probably has more
significant comments to make, whereas mine are fairly minor. However, it
seems best to write down my thoughts down before forgetting them entirely.
On 4/16/2010 5:23 AM, Thomas Leitner wrote:
> So, how do we make the current syntax shorter?
> *Extensions*: We need to be able to differentiate between extensions
> that have a body and those that don't. As written above a shorthand
> closing tag would also be nice. How about the following (adapted from
> Shawn's proposal) - only using the inline syntax, the block syntax
> will be the same except that the start/end tags have to appear on a
> separate line:
> 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
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 :}
> 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.
> 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.
-- ES
More information about the kramdown-users
mailing list