Open chrisjsewell opened 2 years ago
One thing I'd note here, is that pandoc have their header attributes inline with the heading text, rather than above it:
# header {#target}
But actually this is contrary to the Markdown creator's proposal
Allow attributes to be added on the line before any block element and directly after any inline element
which I think makes a lot more sense
Another pointer to some users asking questions about this:
Relevant links:
Attributes are a common Markdown syntax extension, e.g.
{#id .class value=key}
, which I think might be useful in MyST.At a block-level, I think this would be relatively simple to implement in https://github.com/executablebooks/MyST-Parser, since they would essentially follow the same rules/logic as targets, e.g.
would be equivalent to
But then extra logic could also be added, to propagate classes as well as identifiers (for now we would ignore key/values), e.g.
Would relate to HTML like
another place they could be added, is for defining role options, e.g.
{name}`content`{#id .class key=value}
The problem here, though, is that docutils roles syntax does not support options. Although it is of note, that the role functions themselves, do actually accept an
options
key-word: https://github.com/live-clones/docutils/blob/48bb76093b4ba83654b2f2c86e7c52c4bb39c63b/docutils/docutils/parsers/rst/roles.py#L197-L211