MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

Use pandoc divs for directives

Open hason opened this issue 3 years ago • 1 comments

I propose to use pandoc syntax for divs for directives (try):

::: {.block param="1" argument="Title"}
Text in block

::: {.nested param="2"}
Text
:::
:::

hason avatar Sep 03 '20 14:09 hason

This syntax is already essentially available in https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html#admonition-directives

Arbitrary use is not supported though, because they need to map onto a node type in the AST.

In pandoc, although you have these divs, they only really work for HTML, to literally add a div tag around content, unless you specifically create a filter to deal with them. They don't extend to other output formats like LaTeX where IIRC they are just dropped.

Do you have a specific use case?

chrisjsewell avatar Sep 03 '20 20:09 chrisjsewell