Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Transform HTML files to Markdown in a Grunt task
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tasks ESLint upgrade with more validation options for better JavaScript
test Remove linting problems
.eslintrc Finally can validate spaces/tabs via ESLint
.travis.yml Travis CI configuration unification to contain iojs and 0.12
Gruntfile.js New ESLint rules
LICENSE-MIT Merge branch 'master' of
package.json ESLint upgrade


Transform HTML files to Markdown in a Grunt task

Build Status Code Climate Dependency Status Built with Grunt Analytics

Getting Started

This Grunt task plugin transforms the given HTML files to the Markdown format.

This plugin requires Grunt ~0.4.1 and is dependant of HTML to Markdown converter ~0.0.1.

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-html2md --save-dev

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


The "html2md" task


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

  html2md: {
    your_target: {
      // Target-specific source file lists and/or file write options go here.


Options are passed directly to grunt.file.write method.


Type: String Default value: 'utf8'

The file encoding used for saving the resulting Markdown files.

Usage Examples

Default Options

In this example, the default options are used, as there aren't any at the moment. All the files matching the src/*.html and legacy/*.html selectors will be used as HTML sources, which will be converted to Markdown files placed in the same folder as the given source file.

  html2md: {
    main: {
      options: {
        encoding: 'utf8'
      src: [


Please refer to a GitHub blog post on how to create somewhat perfect pull request.

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.


Unit tests are done with Nodeunit.

npm install -g venus

Release History

  • 2014-08-23 v0.1.2 Dependencies update and general code quality
  • 2013-12-20 v0.1.1 Linting with eslint instead of JSHint for better coverage
  • 2013-07-23 v0.1.0 Initial release


Copyright (c) Juga Paazmaya

Licensed under the MIT license.

Something went wrong with that request. Please try again.