jupyter-book / myst-spec

MyST is designed to create publication-quality, computational documents written entirely in Markdown.
https://mystmd.org/spec
MIT License
14 stars 6 forks source link

Drop indented code blocks #50

Open chrisjsewell opened 1 year ago

chrisjsewell commented 1 year ago

As discussed in https://johnmacfarlane.net/beyond-markdown.html (the creator of Markdown)

  1. There should be one clear way of doing things, fenced code block are already the primary way of adding a code block
  2. explicit is better than implicit, fenced code blocks provide a much more explicit indication of the code block
  3. indented code block enforce a lot of technical limitations for the syntax/parser

As an example, you can look at https://markdown-it.github.io/ compared to https://djot.net/playground/ (a proposed successor to commonmark). In djot it is perfectly fine to indent syntax blocks with any number of spaces, without having it become a code block

::::admonition

     :::admonition

     s

     :::

::::

This would be a breaking change from CommonMark, but one that should be possible

mgielda commented 1 year ago

100% support. Actually probably going towards a "subset" of CommonMark like djot in some regards (i.e. one where certain things just don't work because they're ugly/confusing) is nice. We won't miss indented code blocks. Having come from an rst background, that was the worst bit :D