From 8b71d521e658342a08e20db5690d7e995e527f7d Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sun, 25 Jan 2015 21:46:04 -0500 Subject: [PATCH] actually add some comments --- lib/index.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/index.js b/lib/index.js index a2c3f5e..d3efcb4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -118,10 +118,44 @@ var parseExpressions = function(expr){ return expressions; }; +/* + * comment: | + * Parse documentation information from the provided filename argument + * params: + * - name: filename + * type: String + * comment: filename of the script you wish to parse + * - name: options + * type: Object + * comment: | + * Available options: + * - tolerant: try to keep parsing the file even if errors are encountered [default: true] + * returns: + * type: Array + * comment: a list of doc comments parsed from the source filename + */ module.exports.parseFile = function(filename, options){ return module.exports.parseContents(fs.readFileSync(filename, 'utf-8'), options); }; +/* + * comment: | + * Parse documentation information from the provided string content + * + * This function is also available under `docast.parse(contents, options)` + * params: + * - name: contents + * type: String + * comment: string content to parse docs from + * - name: options + * type: Object + * comment: | + * Available options: + * - tolerant: try to keep parsing the file even if errors are encountered [default: true] + * returns: + * type: Array + * comment: a list of doc comments parsed from the source string contents + */ module.exports.parseContents = function(contents, options){ options = options || {}; var tolerant = (options.tolerant === undefined)? true: options.tolerant;