From cfbf0d915f1e573552ca58e7f39b8778bb056a12 Mon Sep 17 00:00:00 2001 From: Paul Vorbach Date: Wed, 5 Feb 2014 11:09:47 +0100 Subject: [PATCH] Documentation for pdc.stream() --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f4b24e1..3ae6316 100644 --- a/README.md +++ b/README.md @@ -44,20 +44,18 @@ pdc(src, from, to, [args,] [opts,] callback); * `src` is a string containing the entire source text, that shall be converted. - * `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 pandocs version). + * `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]. * `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 a string containing the converted text. -[spawn]: http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options - ~~~ js pdc.path = 'pandoc'; ~~~ @@ -65,6 +63,24 @@ pdc.path = 'pandoc'; * `pdc.path` is a string containing the name or absolute path to the 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 If you encounter any bugs or issues, feel free to open an issue at