mirror of
https://github.com/slidevjs/slidev.git
synced 2026-09-14 20:46:32 +08:00
1.3 KiB
1.3 KiB
relates, tags, description
| relates | tags | description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
Use the Prettier plugin to format your slides. |
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
::: code-group
npm i -D prettier prettier-plugin-slidev
pnpm i -D prettier prettier-plugin-slidev
yarn add -D prettier prettier-plugin-slidev
bun add -D prettier prettier-plugin-slidev
deno add -D npm:prettier npm:prettier-plugin-slidev
:::
2. Activate the plugin
Create or modify your prettier configuration file to activate the plugin:
{
"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.