npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

remarkablejs-loader

0.1.5 • Public • Published

Remarkable loader for webpack Version Build Status Dependency Status

Parses source as Markdown using the awesome Remarkable parser.

Installation

$ npm install --save remarkablejs-loader

Usage

Documentation: Using loaders

In your webpack.config.js file:

module.exports = {
  module: {
    loaders: [{
      test:   /\.md/,
      loader: 'remarkablejs-loader',
      options:{
          loader: 'remarkablejs-loader',
                      options: {
                        html: true,
                        xhtmlOut: true,
                        breaks: true,
                        langPrefix: 'hljs ',
                        highlight: function (str, lang) {
                          if (lang && hljs.getLanguage(lang)) {
                            try {
                              return hljs.highlight(lang, str).value;
                            } catch (err) {
                            }
                          }
          
                          try {
                            return hljs.highlightAuto(str).value;
                          } catch (err) {
                          }
          
                          return ''; // use external default escaping
                        }
                      },
          plugins:[function (md) {
                           md.renderer.rules.table_open = function(){
                               return `<div style="overflow: auto;"><table
                   class="table table-striped table-bordered table-condensed table-hover"
                   style="white-space:nowrap;">`;
                           };
                           md.renderer.rules.table_close =function() {
                               return `</table></div>`;
                           };
                       }]
      }
    }]
  }
};

Meta

Contributors

License

Copyright (c) 2014 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.

install

npm i remarkablejs-loader

Downloadsweekly downloads

1

version

0.1.5

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability