@outcome-co/webpack-remark-loader
A webpack loader for Markdown files, loading them as mdasts
Last updated 6 months ago by d-tw .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @outcome-co/webpack-remark-loader 
SYNC missed versions from official npm registry.

webpack-remark-loader-js

ci-badge version-badge

A Webpack loader for Markdown using remark.

Installation

npm install @outcome-co/webpack-remark-loader

Usage

The loader outputs a javascript object that complies with either mdast or hast according to the options.

// webpack.config.js

{
    module: {
        rules: [{
            test: /\.md$/,
            use: [
                {
                    loader: '@outcome-co/webpack-remark-loader',
                    options: {
                        // Your options
                    }
                }
            ]
        }]
    }
}

Options

const options = {
    // Remove empty paragraphs in the Markdown file
    // using https://github.com/syntax-tree/mdast-squeeze-paragraphs
    // Default: true
    squeezeParagraphs: true,

    // Remove the position info from the AST
    // using https://github.com/syntax-tree/unist-util-remove-position
    // Default: true
    removePositions: true,

    // Convert from mdast to hast
    // using https://github.com/syntax-tree/mdast-util-to-hast
    //
    // Can take 3 values, or null.
    //
    // 'strip': converts the mdast to hast, removing any inline HTML
    // from the original Markdown.
    //
    // 'raw': converts the mdast to hast, converting inline HTML to 
    // hast nodes, without sanitization.
    //
    // 'sanitize': converts the mdast to hast, converting inline HTML to 
    // hast nodes, removing dangerous tags.
    //
    // Default: null
    hastConversion: null
}

API

Read the API docs here.

Development

Remember to run ./pre-commit.sh when you clone the repository.

Current Tags

  • 1.1.1                                ...           latest (3 months ago)

8 Versions

  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           5 months ago
  • 1.0.6                                ...           6 months ago
  • 1.0.5                                ...           6 months ago
  • 1.0.4                                ...           6 months ago
  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |