Replies: 1 comment 1 reply
-
Hi! Currently mdformat CLI uses all installed plugins. There is no way to disable them. You could use some tooling to run mdformat in a virtual environment with the correct plugins to achieve what you want. You could configure mdformat for pre-commit and run pre-commit run mdformat --files <filename> instead of mdformat <filename> or perhaps just create a virtual environment yourself
Also
We can consider this if there is a reason the aforementioned solutions are not acceptable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am a little confused about how to enable/disable installed plugins when using the mdformat CLI. The documentation states that both code formatter plugins and parser extension plugins have to be explicitly enabled, not just installed:
and
However, it seems that the
mdformat
CLI will enable any plugins that is installed, and I can find no way to not enable any of the installed plugins. For example:I have a small file with some GitHub formatted Markdown:
I have no mdformat plugins installed:
and mdformat doesn't like the GFM syntax
❯ mdformat --check doc.md Error: File "/Users/bquorning/Code/mdformat-test/doc.md" is not formatted.
Then I install two plugins
The plugins are now known to mdformat:
and now mdformat accepts the GFM syntax:
It would be nice if I could enable plugins in the
.mdformat.toml
file. That would allow me to 1) not use all installed plugins by default, and 2) refuse to run if a required plugin is missing.Footnotes
Code formatter plugins documentation ↩
Parser extension plugins documentation ↩
Beta Was this translation helpful? Give feedback.
All reactions