0.6.3 • Published 1 year ago

vite-plugin-solid-marked v0.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vite-plugin-solid-marked

Vite plugin for solid-marked, MDX/Markdown compiler for SolidJS

NPM JavaScript Style GuideOpen in StackBlitz

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

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

Sponsors

License

MIT © lxsmnsyc

0.6.3

1 year ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago