Prettier Plugin â
The Slidev's syntax may be incompatible with the default Markdown parser of Prettier. To solve this, Slidev provides a Prettier plugin to format your slides. You can use it with your favorite editor that supports Prettier.
1. Install â
bash
npm i -D prettier prettier-plugin-slidev
bash
pnpm i -D prettier prettier-plugin-slidev
bash
yarn add -D prettier prettier-plugin-slidev
2. Activate the plugin â
Create or modify your prettier configuration file to activate the plugin:
json
{
"overrides": [
{
"files": ["slides.md", "pages/*.md"],
"options": {
"parser": "slidev",
"plugins": ["prettier-plugin-slidev"]
}
}
]
}
Note that only specifying plugins
is not enough, because Slidev and common Markdown files share the same file extension .md
.