Skip to content

typematter/svelte-mdast

Repository files navigation

Svelte Mdast

Transform Mdast into Svelte components.

Installing

Add the @typematter/svelte-mdast package dependency to your Svelte / SvelteKit project:

npm install --save-dev @typematter/svelte-mdast

# or
yarn add -D @typematter/svelte-mdast

# or
pnpm add -D @typematter/svelte-mdast

Usage

<script lang="ts">
	import { components } from '@typematter/svelte-mdast';
	import { Unist } from '@typematter/svelte-unist';
	import { u } from 'unist-builder';

	const ast: import('mdast').Root = u('root', [
		u('heading', { depth: 1 as const }, [u('text', 'Hello, World!')])
	]);
</script>

<Unist {ast} />

Test

npm test

License

MIT

Copyright

Copyright © 2025 Matthew Gibbons

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published