vite-plugin-solid-marked
v0.6.3
Published
Vite plugin for solid-marked
Downloads
10
Readme
vite-plugin-solid-marked
Vite plugin for solid-marked, MDX/Markdown compiler for SolidJS
Install
npm i -D solid-marked vite-plugin-solid-marked vite-plugin-solid
yarn add -D solid-marked vite-plugin-solid-marked vite-plugin-solid
pnpm add -D solid-marked vite-plugin-solid-marked vite-plugin-solid
Features
- Supports Markdown and MDX
- Github-flavored Markdown support
- Fully customizable
- mdast compliant
TBA
- Frontmatter
- Directive
- Table of Contents
- Math
- Support for plugins
Usage
Vite
vite.config.js
import solidPlugin from 'vite-plugin-solid';
import solidMarkedPlugin from 'vite-plugin-solid-marked';
export default {
plugins: [
solidMarkedPlugin({
// Module where `useMDX` is going to be imported.
source: 'my-mdx-provider',
}),
solidPlugin(),
],
};
useMDX
Components generated by solid-marked
uses the fundamental components from an MDX provider, this is through the use of useMDX
which is imported from the module.
Example module
export function useMDX() {
return {
builtins: {
Link(props) {
return (
<a href={props.url} title={props.title}>{props.children}</a>
);
},
},
};
}
Typescript
/// <reference types="solid-marked/env">
Sponsors
License
MIT © lxsmnsyc