svelte-preprocess-md
v0.1.3
Published
Write svelte components as markdown files
Downloads
9
Maintainers
Readme
svelte-preprocess-md
Example
<script>
import Component from './Component';
let title = 'Hello World';
</script>
# {title}
<Component />
Usage
// rollup.config.js
import svelte from 'rollup-plugin-svelte';
import md from 'svelte-preprocess-md';
export default {
// ...
plugins: [
svelte({
extensions: ['.html', '.md'],
preprocess: md()
})
]
}
API
md([options, extend])
options
- markdown-it optionsextend
- Extend the markdown-it renderer
// ...
preprocess: md()
preprocess: md({ linkify: true })
preprocess: md(md => {
return md
.use(plugin1)
.use(plugin2, options);
});
preprocess: md(
{ typographer: false},
md => {
return md
.use(plugin3);
}
)