Files
2025-06-11 11:22:39 +09:00

1.3 KiB

relates, tags, description
relates tags description
features/block-frontmatter
GitHub Repo
https://github.com/slidevjs/prettier-plugin
Prettier
https://prettier.io/
editor
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.