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

    Last publish

    Collaborators

    • avatar