Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Specify path to pandoc command in OS #4

Merged
merged 2 commits into from

2 participants

@alekseykulikov

Hi,
Thanks for good wrapper. I found, it is very useful to specify path to pandoc runner from node.
I hope it will useful for someone else.

Best.

@pvorb pvorb merged commit 74966b8 into pvorb:master
@alekseykulikov

Thanks!
Maybe it's a time to release 0.1.3? ;)

@pvorb
Owner

I just published v0.2.0. It's already on npm. See the README for more info. (Existing code will still work)

@alekseykulikov

Great update, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 1 deletion.
  1. +11 −0 README.md
  2. +4 −1 pandoc.js
View
11 README.md
@@ -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
5 pandoc.js
@@ -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';
Something went wrong with that request. Please try again.