1.1.12 • Published 3 years ago

@outcome-co/webpack-remark-loader v1.1.12

Weekly downloads
34
License
ISC
Repository
github
Last release
3 years ago

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.

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago