# grunt-pandoc

> Grunt Task Pandoc Wrapper

Latest version **0.2.3** (published 2013-07-02) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install grunt-pandoc
pnpm add grunt-pandoc
yarn add grunt-pandoc
bun add grunt-pandoc
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2013-07-02 |
| First published | 2013-07-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | sakuya sugo |
| Maintainers | sakunyo |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-pandoc
- Repository: https://github.com/sakunyo/grunt-pandoc
- Issues: https://github.com/sakunyo/grunt-pandoc/issues
- npm.io page: https://npm.io/package/grunt-pandoc

## Recent versions

- 0.2.3 (latest) — 2013-07-02
- 0.2.2 — 2013-07-02
- 0.2.1 — 2013-07-01
- 0.2.0 — 2013-07-01

## README

# grunt-pandoc

Pandoc Publish Runner for Grunt.

Markdown to Other Document Format Convert.

* Markdown to EPUB
* Markdown to HTML


## Getting Started
This plugin requires
* Grunt `~0.4.1`
* Pandoc Binary
Download => [http://johnmacfarlane.net/pandoc/](http://johnmacfarlane.net/pandoc/)


If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out
the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as
 well as install and use Grunt plugins. Once you're familiar with that process, you may install
 this plugin with this command:

```shell
npm install grunt-pandoc --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-pandoc');
```

## The "pandoc" task

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


#### Markdown to EPUB
```js
function myFilterFunc(context: string):string {
	return context;
}

grunt.initConfig({
  pandoc: {
    My_EPUB: { // OUTPUT file name
      configs: {
        "publish"   : 'EPUB',                 // Publish File Format.
        "title"     : "My EPUB Title",        // EPUB Title
        "metadata"  : "include/metadata.xml", // EPUB include META data File Path.
        "stylesheet": "include/style.css"     // EPUB include StyleSheet File Path.
        "filter"    : myFilterFunc            // Calling Before Execute Command.
      },
      files: {
        "chapters": [
          "chapters/header.md", // Require Header File.
          "chapters/content.md" // Chapter Files.
          ...
        ]
      }
    }
  }
})
```

#### Markdown to HTML
```js
function myFilterFunc(context: string):string {
	return context;
}

grunt.initConfig({
  pandoc: {
    toHtml: {
      configs: {
        "publish"   : 'HTML',       // Publish File Format.
        "filter"    : myFilterFunc  // Calling Before Execute Command.
      },
      files: {
        "from": [
          "input/toHTML.md",
          "input/toHTML.md"
          ...
        ]
      }
    }
  }
})
```

## Release History
* 2013-07-02	0.2.3
	* Execute User Filter before Execute Command.
	* Publish Format Markdown to HTML.
* 2013-07-01	0.2.1
	* Grunt 0.3 -> 0.4.1
	* Publish Format Markdown to EPUB.

---
_Source: https://npm.io/package/grunt-pandoc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
