jgm / djot

A light markup language
https://djot.net
MIT License
1.66k stars 43 forks source link

Store `Div` class separately to other classes #140

Open chrisjsewell opened 1 year ago

chrisjsewell commented 1 year ago

This would principally be for post-processing. With code fences it is clear in the AST what was set as the "argument", whereas in divs this is not clear.

{.a .b}
```cd
e

{.a .b} :::cd e :::

doc code_block text="e\ " lang="cd" class="a b" div class="a b cd" para str text="e"


I'm thinking along the lines of rST, where you have a clear, singular name for directives:

```restructuredtext
.. note::
   :class: a b c

   Content

Also, the div argument is currently not recognised, if it is only one character long:

:::a
b
:::
doc
  div
    para
      str text="b"
jgm commented 1 year ago

I think this is definitely worth considering.

jgm commented 1 year ago

for now I've just addressed the one-character class name issue.