# @mheedev/rollup-plugin-markdown

> Complete Markdown parser for modern static websites

Latest version **0.0.6** (published 2020-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mheedev/rollup-plugin-markdown
pnpm add @mheedev/rollup-plugin-markdown
yarn add @mheedev/rollup-plugin-markdown
bun add @mheedev/rollup-plugin-markdown
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2020-08-23 |
| First published | 2020-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 3 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | @mheedev |
| Maintainers | mhee |
| Keywords | rollup, static, markdown, syntax, highlight |

## Links

- npm: https://www.npmjs.com/package/@mheedev/rollup-plugin-markdown
- Repository: https://github.com/mheedev/rollup-plugin-markdown
- Homepage: https://github.com/mheedev/rollup-plugin-markdown/tree/master#readme
- Issues: https://github.com/mheedev/rollup-plugin-markdown/issues
- npm.io page: https://npm.io/package/@mheedev/rollup-plugin-markdown

## Dependencies (3)

- [shiki](https://npm.io/package/shiki.md) ^0.1.7
- [markdown-it](https://npm.io/package/markdown-it.md) ^11.0.0
- [front-matter](https://npm.io/package/front-matter.md) ^4.0.2

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2020-08-23
- 0.0.5 — 2020-08-23
- 0.0.4 — 2020-05-18
- 0.0.3 — 2020-05-17

## README

# rollup-plugin-markdown

Complete Markdown parser specifically built for modern staticly exported websites. It does not require any dependencies to be included in your build, all styles are inlined into the output HTML.

## Dependenices

This plugin uses the following dependencies:
| plugin | purpose |
| ------ | ------- |
| [front-matter](https://github.com/jxson/front-matter) | Parsing of Markdown file attributes |
| [markdown-it](https://github.com/markdown-it/markdown-it) | Render Markdown as HTML |
| [shiki](https://github.com/octref/shiki) | Inline extendable syntax highlighting |

## Usage

```bash
npm i --save-dev @mheedev/rollup-plugin-markdown
# yarn add -D @mheedev/rollup-plugin-markdown
```

```js
// rollup.config.js

import markdownPlugin from '@mheedev/rollup-plugin-markdown';

export default {
  plugins: [
    markdownPlugin(),
    // ...
  ],
  /// ...
}
```

The plugin will parse any `.md` files that you include into your project, parse any frontmatter and apply any inline syntax highlighting that you need using the standard code block syntax for Markdown parsers:

````md
---
title: 'Hello world'
author: 'dev'
---

# Hello world

```js
console.log('My first code block!');
```

````

## Theming

You can choose one of the [themes supported by Shiki](https://github.com/octref/shiki/tree/master/packages/themes). The default theme is [nord](https://github.com/arcticicestudio/nord-visual-studio-code).

To set a theme, you can pass it into the theme options like so:

```js
// rollup.config.js

import markdownPlugin from '@mheedev/rollup-plugin-markdown';

export default {
  plugins: [
    markdownPlugin({ theme: 'monokai' }),
    // ...
  ],
  /// ...
}
```

## Enable features of markdown-it

This package uses markdown-it internally to process your Markdown input.

Therefore it is possible to pass any configuration options to it using the `markdown` key:

```js
// rollup.config.js

import markdownPlugin from '@mheedev/rollup-plugin-markdown';

export default {
  plugins: [
    markdownPlugin({
      theme: 'monokai',
      markdown: {
        typographer: true,
        // ... pass any additional options to markdown-it here.
      }
    }),
    // ...
  ],
  /// ...
}
```

To see a full list of options that can be provided to markdown-it, please refer to their [documentation](https://github.com/markdown-it/markdown-it)

## Changelog

### 0.0.5

- Pass additional options to markdown-it

### 0.0.1

- Initial release

### 0.0.4

- Added [theme selection](https://github.com/mheedev/rollup-plugin-markdown/tree/master#Theming) to the plugin options

## Credits

- Inspired to include Shiki based on a [post by swyx](https://www.swyx.io/writing/svelte-static/)

- This project was heavily inspired by Jack Franklin's [rollup-plugin-markdown](https://github.com/jackfranklin/rollup-plugin-markdown)

## License

MIT &copy; [Ricardo van Hoepen](https://github.com/mheedev)

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