Skip to content

amandaXCY/markdown-loader

 
 

Repository files navigation

markdown-loader

markdown-loader for webpack using marked.

Dependency Status Build Status

Installation

npm install markdown-loader

Usage

Since marked's output is HTML, it's best served in conjunction with the html-loader.

Webpack 2

{
    module: {
        rules: [{
                test: /\.md$/,
                use: [
                    {
                        loader: "html-loader"
                    },
                    {
                        loader: "markdown-loader",
                        options: {
                            /* your options here */
                        }
                    }
                ]
            }]
    }
}

Options

Simply pass your marked options as shown above. In order to specify custom renderers, simply set the options.renderer-option on your webpack options.

// webpack.config.js

const marked = require("marked");
const renderer = new marked.Renderer();

return {
    module: {
        rules: [{
                test: /\.md$/,
                use: [
                    {
                        loader: "html-loader"
                    },
                    {
                        loader: "markdown-loader",
                        options: {
                            pedantic: true,
                            renderer
                        }
                    }
                ]
            }]
    }
}

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Sponsors

About

markdown loader for webpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 57.4%
  • JavaScript 36.7%
  • HTML 5.9%