/pandoc-filter-node

Pandoc filtering for Node.js

Primary LanguageJavaScriptMIT LicenseMIT

About

Node.js port of the Python pandocfilters for filtering with Pandoc

Install

npm install -g pandoc-filter

Example

#!/usr/bin/env node

// Pandoc filter to convert all text to uppercase

var pandoc = require('pandoc-filter');
var Str = pandoc.Str;

function action(type,value,format,meta) {
	if (type === 'Str') return Str(value.toUpperCase());
}

pandoc.stdio(action);

Compatibility Note

v0.1.6 is required for pandoc versions after 1.17.2 to support the new JSON format. See this issue for details.

Credits

Thanks to John MacFarlane for Pandoc.

License

MIT