executablebooks / mdformat-myst

Mdformat plugin for MyST compatibility
MIT License
7 stars 2 forks source link

Format directive options #3

Closed hukkin closed 3 years ago

hukkin commented 3 years ago

Format directive options

Input 1:

```{directive_name} arguments
:option1: name
:option2: other

content...

Input 2:
````markdown
```{directive_name} arguments
:option1: name
:option2: other
content...

Output:
````markdown
```{directive_name} arguments
---
option1: name
option2: other
---
content...


That is, use the YAML-frontmatter-like syntax for consistency and minimized diffs.

Format the fronmatter-like block with a YAML formatter.

Remove redundant initial empty line from content, because the yaml `---` already separates visually.