# @commi/rollup-plugin-md2vue

> Roll markdown to Vue 3 component with Rollup, extract 'demo' and convert it into execution effect and code display.

Latest version **1.0.1** (published 2021-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @commi/rollup-plugin-md2vue
pnpm add @commi/rollup-plugin-md2vue
yarn add @commi/rollup-plugin-md2vue
bun add @commi/rollup-plugin-md2vue
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-09-30 |
| First published | 2021-09-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 715.2 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liuyu666 |
| Maintainers | milkiq |
| Keywords | rollup, plugin |

## Links

- npm: https://www.npmjs.com/package/@commi/rollup-plugin-md2vue
- Repository: https://github.com/CodingCommunism/rollup-md2vue
- Homepage: https://github.com/CodingCommunism/rollup-md2vue#readme
- Issues: https://github.com/CodingCommunism/rollup-md2vue/issues
- npm.io page: https://npm.io/package/@commi/rollup-plugin-md2vue

## Dependencies (3)

- [markdown-it](https://npm.io/package/markdown-it.md) ^8.4.1
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^4.1.1
- [markdown-it-container](https://npm.io/package/markdown-it-container.md) ^2.0.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-09-30
- 1.0.0 — 2021-09-30

## README

# rollup-plugin-md2vue

> Roll markdown to Vue 3 component with Rollup, extract 'demo' and convert it into execution effect and code display.


``` js
import md2vue from 'rollup-plugin-md2vue'

export default {
  plugins: [
    md2vue(/* options */)
  ]
}
```

## Options

``` js
export interface Options {
  include: string | RegExp | (string | RegExp)[]
  exclude: string | RegExp | (string | RegExp)[]
  
  // the path of your custom demo-block component
  // e.g. '/src/components/demo-block.vue'
  blockComponent: string
}
```



## Question

- Q: No highlight of code?

  - Check your dependency, your project must install `hightlight.js`.
  - Check init hightlight.js and import its style file. [Use highlight.js in ES6 Modules](https://github.com/highlightjs/highlight.js#es6-modules--import)

- Q: custom demo-block component can't display?

  - Your component must have three slot for demo's title(default), display area(name='source'), source code(name='highlight')

    ```html
    <template>
      <slot></slot>
      <div>
        <slot name="source"></slot>
      </div>
      <div>
        <slot name="highlight"></slot>
      </div>
    </template>
    <script>
    export default {
      name: 'demo-block'
    }
    </script>
    <style>
    </style>
    ```

---
_Source: https://npm.io/package/@commi/rollup-plugin-md2vue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
