MyST-Parser: Markdown Fenced code block with info vs. code-block directive
The MyST documentation describes the {code-block} $LANGUAGE directive/idiom and uses it in many places.
Common Markdown already supports a simpler construct Fenced code block with info string that does the same thing (as long as no code-block parameters/attributes are needed).
EXAMPLE: Using code-block directive in MyST / Markdown
```{code-block} python
def func():
pass
```
EXAMPLE: Using Markdown Fenced Code Block with info string (here: info=python)
```python
def func():
pass
```
DESIRED SOLUTION: I would suggest that the Markdown Fenced code block with info is also documented as an alternative (that is more natural to Markdown users). Maybe, it should also be contained in the examples section of the documentation.
ASSUMPTION:
I assume that Markdown Fenced code block with info is properly handled (in Sphinx) by leading to the corresponding code-block directive/construct.
SEE ALSO:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 21 (10 by maintainers)
I only went and bloody did it 😝 https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#block-attributes