Except custom extentions, which can change everything, it would be nice to have generic syntax for marcos. Because that will simplify adding new commands with minimal efforts.
Now it's easy to modufy ``` behavior (write custom renderer), but that's not enougth:
- those can not be nested (to be precise, only 2-level nesting allowed, with ``` + ~~~)
- those can have params on block mode only
What we need:
- block macro. Example - spoiler, math formula, diagram, sidebar and so on.
- inline macro. Example - inline formula
- ??? (don't know) self-closed block. Example - blog entry cut marker
- ??? (don't know) self-closed inline element. Example - don't know.
(3,4) are under very big question, and can be done via autoreplacer. For example. <cut>
-> <!--cut-->
Feel free to suggest alternate formats. Just post your example, or link to implementation or discussion in other repo. If you don't like existing example - just suggest a better one, to be constructive
Draft
block macro
Generic form:
!!:name <anything, used as params>
...
... content ...
...
!!
- it can be nested
- unknown macro name or unmanched closing pair will be rendered as simple markdown text.
Example 1:
!!:spoiler Click me to expand
content
!!
Example 2:
inline macro
TBD. Still no ideas about good human-readable form
See https://github.com/jonschlinkert/markdown-symbols . Probably, inline macro do not need name-based approach, and will be ok with custom delimiters for each case.