markdoc-svelte
v4.2.0
Published
A preprocessor to render Markdoc in Svelte
Downloads
623
Readme
markdoc-svelte
Process Markdown and Markdoc files into Svelte components using Markdoc. Use Markdoc defaults out of the box or configure Markdoc schema to your needs.
Install
Install markdoc-svelte in your SvelteKit project.
npm install markdoc-svelteAmend your SvelteKit config in svelte.config.js to:
- Process files with the extensions you choose (such as
.mdocand.md). - Include the preprocessor.
import { markdocPreprocess } from "markdoc-svelte";
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: [".svelte", ".mdoc", ".md"],
preprocess: [markdocPreprocess()],
};Docs
See full examples and more options at the markdown-svelte docs.
