🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

grunt-markade

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-markade

A Markade build step for grunt

0.2.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

grunt-markade

A Markade build step for grunt

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-markade --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-markade');

The "markade" task

Overview

In your project's Gruntfile, add a section named markade to the data object passed into grunt.initConfig().

grunt.initConfig({
  markade: {
    tem: {
      options: {
        "template": "template.jade"
      },
      files: {
        'output.html': "data.md"
      }
    },
  },
});

Options

options.template

Type: String Default value: empty.jade

A file path to the Jade template. If none is specified it simply parses out all Markdown content.

options.jade

Type: Object Default value: {}

An object with options to pass to Jade.compile. Values like pretty: true.

Usage Examples

Default Options

In this example, the default options are used to compile a Markade file. So if file.md has content **bold** text then default.html would be <b>bold</b> text.

grunt.initConfig({
  markade: {
    no_template: {
      options: {},
      files: {
        'dest/default.html': ["src/file.md"],
      },
    }
  },
});

Template

Add a template option to parse the data through the Jade template.

grunt.initConfig({
  markade: {
    layout: {
      options: {
        template: 'templates/layout.jade'
      },
      files: {
        'index.html': 'index.md'
      },
    }
  },
});

Directory

You can compile all files in a directory.

grunt.initConfig({
  markade: {
    options: {
      template: 'templates/layout.jade'
    },
    files: {
      'public': ['index.md', 'about.md', 'contact.md']
    },
  },
});

#### Jade Options

You can pass objects to Jade.

```js
grunt.initConfig({
  markade: {
    with_layout: {
      options: {
        "template": "templates/index.jade",
        "jade": {
          "pretty": true
        }
      },
      files: {
        "public/index.html": "data/index.md"
      }
    }
  },
});

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

Keywords

gruntplugin

FAQs

Package last updated on 04 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts