# markdown-html-webpack-plugin

> markdown-html-webpack-plugin

Latest version **1.0.1** (published 2017-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-html-webpack-plugin
pnpm add markdown-html-webpack-plugin
yarn add markdown-html-webpack-plugin
bun add markdown-html-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-11-25 |
| First published | 2017-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | KingZhang |
| Maintainers | zhanghaoquan |
| Keywords | filelist, plugin, webpack |

## Links

- npm: https://www.npmjs.com/package/markdown-html-webpack-plugin
- Repository: https://github.com/KingZhang/markdown-html-webpack-plugin
- Homepage: https://github.com/KingZhang/markdown-html-webpack-plugin#readme
- Issues: https://github.com/KingZhang/markdown-html-webpack-plugin/issues
- npm.io page: https://npm.io/package/markdown-html-webpack-plugin

## Dependencies (1)

- [marked](https://npm.io/package/marked.md) ^0.3.6

## 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) — 2017-11-25
- 1.0.0 — 2017-11-19

## README

# markdown to html Plugin
Convert markdown as html file to export path.
if non-markdown file, just copy to export path.
if want to insert convert content to a template html file, just provide the template.html and replace with ``` {{markdownContent}} ```

## Install
```bash
npm install --save-dev markdown-html-webpack-plugin
```

## Usage
```js
const markdownPlugin = require('markdown-html-webpack-plugin');

module.exports = {
  
  plugins: [
    new markdownPlugin({
        filePath: '../inputPath',
        exportPath: '../public/outPath/',
        isEncodeName: false, // if need to encode file name, like chinese
        template: 'template.html'
      }),
  ]
}
```

## template.html sample

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
</head>
<body>
  <div id="app">{{markdownContent}}</div>
</body>
</html>
```

## Output
```html 
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
</head>
<body>
  <div id="app">
    <h1 id="header1">header1</h1>
    <h2 id="header2">header2</h2>
    <p><img src="image/cat.jpg" alt=""></p>
    <pre>
        <code class="lang-js">
            var test = 1;
            if(test === 1) {
              return true;
            }
        </code>
    </pre>
    </div>
</body>
</html>

```

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