mattjennings / mdsvexamples

Render your Svelte code blocks in MDSveX
35 stars 3 forks source link

feat: support named exports for wrapper components #28

Closed mattjennings closed 1 year ago

mattjennings commented 1 year ago

This adds support for a custom Wrapper when the component is a named export.

Via remark config:

{
  remarkPlugins: [
    [
      examples,
      {
        defaults: {
          Wrapper: ['some-package', 'CustomExample'] // -> import { CustomExample } from 'some-package'
        }
      }
    ]
  ]
}

Via inline config:

```svelte example Wrapper=["some-package", "CustomExample"]