html-webpack-remark-plugin
Render Markdown to React through Remark
Last updated 3 years ago by bebraw .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install html-webpack-remark-plugin 
SYNC missed versions from official npm registry.

html-webpack-remark-plugin - Render Markdown to React through Remark

This is a plugin for html-webpack-plugin that allows you to render Markdown through remark and remark-react and to inject it into html-webpack-plugin template context.

The advantage of doing this is that you'll get HTML out of the box (avoids dangerouslySetInnerHTML). This helps with SEO purposes and makes your page load a bit better.

Usage

import HtmlWebpackPlugin from 'html-webpack-plugin';
import HtmlWebpackRemarkPlugin from 'html-webpack-remark-plugin';

// Import custom programming languages for remark to process
import js from 'highlight.js/lib/languages/javascript';

const config = {
  plugins: [
    new HtmlWebpackPlugin({
      title: pkg.name + ' - ' + pkg.description,
      template: 'lib/index_template.ejs',
      inject: false,

      // Context for the template
      name: pkg.name,
      description: pkg.description,
      demonstration: RENDER_UNIVERSAL ? ReactDOM.renderToString(<App />) : ''
    }),
    new HtmlWebpackRemarkPlugin({
      // Key under which to inject the processed file
      key: 'documentation',

      // Markdown file to read and process
      file: path.join(__dirname, 'README.md'),

      // Custom programming languages to process
      languages: {
        js: js
      }
    }),
    ...
  ],
  ...
}

License

MIT.

Current Tags

  • 0.3.0                                ...           latest (3 years ago)

3 Versions

  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |