Transforms a Markdown AST into Svelte components.
Note
You probably don't want this - look at mdsvex instead.
Add the @accuser/svelte-markdown-provider
package dependency to your Svelte / SvelteKit project:
npm install --save-dev @accuser/svelte-markdown-provider
<script>
import { Markdown, MarkdownProvider } from '@accuser/svelte-markdown-provider';
const node = {
type: 'root',
children: [{
type: 'paragraph',
children: [{
type: 'text',
value: 'Hello, World!'
}]
}]
};
</script>
<MarkdownProvider let:components>
<Markdown {node} {components} />
</MarkdownProvider>