@accuser/svelte-hast
v0.3.0
Published
Transform [Hast](https://github.com/syntax-tree/hast) into Svelte components.
Downloads
60
Readme
Svelte Hast
Transform Hast into Svelte components.
Installing
Add the @accuser/svelte-hast
package dependency to your Svelte / SvelteKit project:
npm install --save-dev @accuser/svelte-hast
Usage
<script lang="ts">
import Hast from '@accuser/svelte-hast';
import { u } from 'unist-builder';
const ast: import('hast').Root = u('root', [
u('element', { tagName: 'h1', properties: {} }, [u('text', 'Hello, World!')])
]);
</script>
<Hast {ast} />
Test
npm test
License
Copyright
Copyrigth © 2024 Matthew Gibbons