From 6625be042c91311a084b8f38e57d4733d445554b Mon Sep 17 00:00:00 2001 From: Alban Mouton Date: Thu, 11 Sep 2014 22:44:52 +0200 Subject: [PATCH] fix doc --- README.md | 12 ++++++------ index.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3fdbbc6..1986648 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ If no callback is given the function will run synchronously and return the resul **Params** - source `string` | `Document` - The content of the stylesheet as a string or a [libxmljs document](https://github.com/polotek/libxmljs/wiki/Document) -- \[callback\] [parseCallback](#parseCallback) - The callback that handles the response. +- \[callback\] [parseCallback](#parseCallback) - The callback that handles the response. Expects err and Stylesheet object. **Returns**: `Stylesheet` - Only if no callback is given. @@ -151,7 +151,7 @@ Parse a XSL stylesheet **Params** - sourcePath `stringPath` - The path of the file -- \[callback\] [parseFileCallback](#parseFileCallback) - The callback that handles the response. +- \[callback\] [parseFileCallback](#parseFileCallback) - The callback that handles the response. Expects err and Stylesheet object. ##class: libxslt~Stylesheet @@ -184,8 +184,8 @@ If no callback is given the function will run synchronously and return the resul **Params** - source `string` | `Document` - The XML content to apply the stylesheet to given as a string or a [libxmljs document](https://github.com/polotek/libxmljs/wiki/Document) -- \[params\] `object` - Parameters passed to the stylesheet ({@linkhttp://www.w3schools.com/xsl/el_with-param.asp}) -- \[callback\] [applyCallback](#Stylesheet..applyCallback) - The callback that handles the response. +- \[params\] `object` - Parameters passed to the stylesheet ([http://www.w3schools.com/xsl/el_with-param.asp](http://www.w3schools.com/xsl/el_with-param.asp)) +- \[callback\] [applyCallback](#Stylesheet..applyCallback) - The callback that handles the response. Expects err and result of the same type as the source param passed to apply. **Returns**: `string` | `Document` - Only if no callback is given. Type is the same as the source param. @@ -195,7 +195,7 @@ Apply a stylesheet to a XML file **Params** - sourcePath `string` - The path of the file to read -- \[params\] `object` - Parameters passed to the stylesheet ({@linkhttp://www.w3schools.com/xsl/el_with-param.asp}) -- \[callback\] [applyToFileCallback](#Stylesheet..applyToFileCallback) - The callback that handles the response. +- \[params\] `object` - Parameters passed to the stylesheet ([http://www.w3schools.com/xsl/el_with-param.asp](http://www.w3schools.com/xsl/el_with-param.asp)) +- \[callback\] [applyToFileCallback](#Stylesheet..applyToFileCallback) - The callback that handles the response. Expects err and result as string. *documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)*. \ No newline at end of file diff --git a/index.js b/index.js index 4ef1197..7d9d3da 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,7 @@ var Stylesheet = function(stylesheetDoc, stylesheetObj){ * If no callback is given the function will run synchronously and return the result or throw an error. * * @param {string|Document} source - The content of the stylesheet as a string or a [libxmljs document]{@link https://github.com/polotek/libxmljs/wiki/Document} - * @param {parseCallback} [callback] - The callback that handles the response. + * @param {parseCallback} [callback] - The callback that handles the response. Expects err and Stylesheet object. * @return {Stylesheet} Only if no callback is given. */ exports.parse = function(source, callback) { @@ -62,7 +62,7 @@ exports.parse = function(source, callback) { * Parse a XSL stylesheet * * @param {stringPath} sourcePath - The path of the file - * @param {parseFileCallback} [callback] - The callback that handles the response. + * @param {parseFileCallback} [callback] - The callback that handles the response. Expects err and Stylesheet object. */ exports.parseFile = function(sourcePath, callback) { fs.readFile(sourcePath, 'utf8', function(err, data){ @@ -83,8 +83,8 @@ exports.parseFile = function(sourcePath, callback) { * If no callback is given the function will run synchronously and return the result or throw an error. * * @param {string|Document} source - The XML content to apply the stylesheet to given as a string or a [libxmljs document]{@link https://github.com/polotek/libxmljs/wiki/Document} - * @param {object} [params] - Parameters passed to the stylesheet ({@linkhttp://www.w3schools.com/xsl/el_with-param.asp}) - * @param {Stylesheet~applyCallback} [callback] - The callback that handles the response. + * @param {object} [params] - Parameters passed to the stylesheet ({@link http://www.w3schools.com/xsl/el_with-param.asp}) + * @param {Stylesheet~applyCallback} [callback] - The callback that handles the response. Expects err and result of the same type as the source param passed to apply. * @return {string|Document} Only if no callback is given. Type is the same as the source param. */ Stylesheet.prototype.apply = function(source, params, callback) { @@ -144,8 +144,8 @@ Stylesheet.prototype.apply = function(source, params, callback) { * Apply a stylesheet to a XML file * * @param {string} sourcePath - The path of the file to read - * @param {object} [params] - Parameters passed to the stylesheet ({@linkhttp://www.w3schools.com/xsl/el_with-param.asp}) - * @param {Stylesheet~applyToFileCallback} [callback] - The callback that handles the response. + * @param {object} [params] - Parameters passed to the stylesheet ({@link http://www.w3schools.com/xsl/el_with-param.asp}) + * @param {Stylesheet~applyToFileCallback} [callback] - The callback that handles the response. Expects err and result as string. */ Stylesheet.prototype.applyToFile = function(sourcePath, params, callback) { var that = this;