Browse Source

actually add some comments

formatter
Brett Langdon 11 years ago
parent
commit
8b71d521e6
1 changed files with 34 additions and 0 deletions
  1. +34
    -0
      lib/index.js

+ 34
- 0
lib/index.js View File

@ -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;


Loading…
Cancel
Save