svelte-mdast-math Svelte Themes

Svelte Mdast Math

Svelte Unist

Transform Mdast into Svelte components.

Installing

Add the @accuser/svelte-hast package dependency to your Svelte / SvelteKit project:

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

Usage

<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} />

Test

npm test

License

MIT

Copyrigth © 2024 Matthew Gibbons

Top categories

Loading Svelte Themes