Docs

mdsvex is markdown with Svelte in it. Learn the language, follow a guide, add a plugin, or look something up.

At a glance

Install

Quick installation instructions.

npm i -D mdsvex@next
pnpm add -D mdsvex@next

Use

Add mdsvex to your Vite config

plugins: [
  mdsvex(config),
  sveltekit()
]

Configure

extensions
use custom extensions
frontmatter
change frontmatter language
templates
wrap documents
select_template
pick templates by path
components
replace elements everywhere
component_mode
replace typed html too
parse_plugins
change the markdown tree

Templates

Wrap mdsvex documents in components.

named templates

Pick a template by name.

---
template: blog
---

opting out

Render a document without one.

---
template: false
---

custom components

Replace HTML elements with custom components.

Frontmatter

Frontmatter is exported as metadata.

---
title: Fabuloso
---

# {metadata.title}

Directives

Markdown syntax for your own components

mdsvex, markdown with Svelte in it. MIT licence.