Skip to content

Commit

Permalink
Documentation for pdc.stream()
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Feb 5, 2014
1 parent 8ba3bf0 commit cfbf0d9
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions README.md
Expand Up @@ -44,27 +44,43 @@ pdc(src, from, to, [args,] [opts,] callback);


* `src` is a string containing the entire source text, that shall be * `src` is a string containing the entire source text, that shall be
converted. converted.
* `from` is a string containing the type of the source text. (E.g. * `from` is a string containing the type of the source text (e.g.
`'markdown'`) `'markdown'`).
* `to` is a string containing the type of the destination text. (E.g. * `to` is a string containing the type of the destination text (e.g.
`'html'`) `'html'`).
* `args` [optional] is an array with additional command line flags (E.g. * `args` [optional] is an array with additional command line flags (e.g.
`[ '-v' ]` for pandocs version). `[ '-v' ]` for pandoc's version).
* `opts` [optional] is an object with additional options for the process. See * `opts` [optional] is an object with additional options for the process. See
[the Node.js docs][spawn]. [the Node.js docs][spawn].
* `callback` is a function that is called after parsing. It takes two * `callback` is a function that is called after parsing. It takes two
arguments `(err, result)`, where `err` is an error or `null` and `result` is arguments `(err, result)`, where `err` is an error or `null` and `result` is
a string containing the converted text. a string containing the converted text.


[spawn]: http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

~~~ js ~~~ js
pdc.path = 'pandoc'; pdc.path = 'pandoc';
~~~ ~~~


* `pdc.path` is a string containing the name or absolute path to the * `pdc.path` is a string containing the name or absolute path to the
executable. Defaults to `'pandoc'`. executable. Defaults to `'pandoc'`.


~~~ js
pdc.stream(from, to, [args,] [opts])
~~~

* `from` is a string containing the type of the source text (e.g.
`'markdown'`).
* `to` is a string containing the type of the destination text (e.g.
`'html'`).
* `args` [optional] is an array with additional command line flags (e.g.
`[ '-v' ]` for pandoc's version).
* `opts` [optional] is an object with additional options for the process. See
[the Node.js docs][spawn].
* Returns a [ChildProcess], which allows you to use pandoc's `stdin`, `stdout`
and `stderr`.

[spawn]: http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
[ChildProcess]: http://nodejs.org/api/child_process.html#child_process_class_childprocess

## Bugs and Issues ## Bugs and Issues


If you encounter any bugs or issues, feel free to open an issue at If you encounter any bugs or issues, feel free to open an issue at
Expand Down

0 comments on commit cfbf0d9

Please sign in to comment.