md-hl-loader

1.1.1 • Public • Published

md-hl-loader

Markdown + Highlight.js => HTML

Install

npm install md-hl-loader -D

Configuration

webpack basic

// ...
rules: [
  {
    test: /\.md$/,
    loader: 'md-hl-loader'
  }
]
// ...

with options

// ...
rules: [
  {
    test: /\.md$/,
    loader: 'md-hl-loader',
    // https://github.com/markdown-it/markdown-it#init-with-presets-and-options
    options: {
      markdownItOptions: {
        html: true
      },
      compileImages: true // compile images
    }
  }
]
// ...

Usage

article.md

# Test

app.js

import article from './article.md'
import 'highlight.js/styles/github.css'
console.log(article) // '<h1>Test</h1>'

Package Sidebar

Install

npm i md-hl-loader

Weekly Downloads

3

Version

1.1.1

License

ISC

Unpacked Size

10.9 kB

Total Files

7

Last publish

Collaborators

  • lianer