Transform Mdast into Svelte components.
Add the @accuser/svelte-hast
package dependency to your Svelte / SvelteKit project:
npm install --save-dev @accuser/svelte-mdast
<script lang="ts">
import { Mdast } from '@accuser/Mdast.svelte';
import { u } from 'unist-builder';
const ast: import('mdast').Root = u('root', [
u('heading', { depth: 1 as const }, [u('text', 'Hello, World!')]),
]);
</script>
<Mdast {ast} />
npm test
Copyrigth © 2024 Matthew Gibbons