@accuser/svelte-markdown-provider
TypeScript icon, indicating that this package has built-in type declarations

0.2.0-next.12 • Public • Published

Svelte Markdown Provider

Transforms Markdown source (as a string) or a Markdown AST into Svelte components.

[!NOTE] You probably don't want this - look at mdsvex or svelte-markdown instead.

Installing

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

npm install --save-dev @accuser/svelte-markdown-provider

Usage

Markdown string

<script>
    import { Markdown } from '@accuser/svelte-markdown-provider';

    const source = 'Hello, World!';
</script>

<Markdown {src} />

Markdown AST

<script>
    import { Markdown } from '@accuser/svelte-markdown-provider';

    const ast = {
        type: 'root',
        children: [{
           type: 'paragraph',
           children: [{
                type: 'text',
                value: 'Hello, World!'
            }]
        }]
    };
</script>

<Markdown {ast} />

Package Sidebar

Install

npm i @accuser/svelte-markdown-provider

Weekly Downloads

3

Version

0.2.0-next.12

License

MIT

Unpacked Size

9.92 kB

Total Files

21

Last publish

Collaborators

  • accuser