Permalink
Browse files

Merge pull request #4 from gingkoapp/master

Customizable path to pandoc executable
  • Loading branch information...
2 parents 349f7d7 + a4e13d6 commit 74966b85364d381cfb42d2bbda68383c41148566 @pvorb committed Feb 5, 2014
Showing with 15 additions and 1 deletion.
  1. +11 −0 README.md
  2. +4 −1 pandoc.js
View
@@ -48,6 +48,17 @@ pandoc(src, from, to[, options], callback);
arguments `(err, result)`, where `err` is an error or `null` and `result` is
a string containing the converted text.
+By default, it uses pandoc command installed to your system.
+To use custom runner change `pandoc.path`.
+
+```js
+var join = require('path').join;
+var pandoc = require('pdc');
+
+pandoc.path = join(process.env.HOME, '.cabal/bin/pandoc');
+pandoc('# Heading', 'markdown', 'html');
+```
+
## Bugs and Issues
If you encounter any bugs or issues, feel free to open an issue at
View
@@ -12,7 +12,7 @@ function pdc(src, from, to, opt, cb) {
if (typeof opt == 'object')
args = args.concat(opt);
- var pandoc = spawn('pandoc', args);
+ var pandoc = spawn(pdc.path, args);
var result = '';
var error = '';
@@ -39,3 +39,6 @@ function pdc(src, from, to, opt, cb) {
pandoc.stdin.end(src, 'utf8');
}
+
+// Path to pandoc runner in your system
+pdc.path = 'pandoc';

0 comments on commit 74966b8

Please sign in to comment.