mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #479] Allow parsing MyST-flavored Markdown #392
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cgranade on GitHub (Jan 12, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/479
The Sphinx and Jupyter-Book projects both make use of MyST, a Markdown variant specialized for formatting documentation and interactive books (https://myst-parser.readthedocs.io/en/latest/index.html). In particular, MyST extends Markdown with a few concepts from reStructuredText (an alternative plain-text format historically used by Sphinx), such as allowing plugins to add new element and block types. For example, the following MyST markup instructs the Sphinx toctree plugin to typeset a table of contents with depth 2, and include several pages in the generated ToC.
Currently, markdownlint seems to interpret the above as a section called
:::{toctree}denoted with setext-style heading markers, and raises warnings about the use of setext versus atx:If possible and reasonable, it would be really helpful to be able to provide an option that allows for markdownlint to ignore MyST-style syntax.
Thank you for an awesome project! 💕
@DavidAnson commented on GitHub (Jan 12, 2022):
The general way to do this is to reference a markdown-it plugin that supports the particular syntax you want. This is how support for math blocks is added, for example. I don't see a plugin for MyST, but perhaps you can find one or write one. I want to keep the core library as close to CommonMark as possible for the broadest utility.
https://www.npmjs.com/search?q=keywords:markdown-it-plugin
@micahjsmith commented on GitHub (Feb 8, 2023):
Also looking to figure this out. Looks like there is now https://www.npmjs.com/package/markdown-it-myst-extras Are there docs/snippets on how to configure markdownlint CLI to use this plugin?
@DavidAnson commented on GitHub (Feb 8, 2023):
markdownlint-cli does not support markdown-it plugins, but markdownlint-cli2 does. Documentation is here and there are examples in the repo: https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc