dox Version: 0.6.1 By @TJ Holowaychuk <tj@vision-media.ca>

Markdown / JSdoc documentation generator

api: API索引


exports

方法 module.exports() module exports

dox: API索引


api

Expose api.

属性 exports.api exports api

parseComments

Parse comments in the given string of js.

方法 exports.parseComments() exports parseComments
参数 js(String)
参数 options(Object)
返回 Array
undefined undefined undefined undefined
可见度 public

trimIndentation

Removes excess indentation from string of code.

方法 exports.trimIndentation() exports trimIndentation
参数 str(String)
返回 String
可见度 public

parseComment

Parse the given comment str.

The comment object returned contains the following

  • tags array of tag objects
  • description the first line of the comment
  • body lines following the description
  • content both the description and the body
  • isPrivate true when "@api private" is used
方法 exports.parseComment() exports parseComment
参数 str(String)
参数 options(Object)
返回 Object
undefined undefined undefined undefined
可见度 public

extractTagParts

Extracts different parts of a tag by splitting string into pieces separated by whitespace. If the white spaces are
somewhere between curly braces (which is used to indicate param/return type in JSDoc) they will not be used to split
the string. This allows to specify jsdoc tags without the need to eliminate all white spaces i.e. {number | string}

方法 exports.extractTagParts() exports extractTagParts
参数 The(str) tag line as a string that needs to be split into parts
undefined Array.<string> undefined An array of strings containing the parts

parseTag

Parse tag string "@param {Array} name description" etc.

方法 exports.parseTag() exports parseTag
参数 (String)
返回 Object
可见度 public

parseTagTypes

Parse tag type string "{Array|Object}" etc.
This function also supports complex type descriptors like in jsDoc or even the enhanced syntax used by the
google closure compiler

The resulting array from the type descriptor {number|string|{name:string,age:number|date}} would look like this:

[
  'number',
  'string',
  {
    age: ['number', 'date'],
    name: ['string']
  }
]
方法 exports.parseTagTypes() exports parseTagTypes
参数 str(String)
返回 Array
可见度 public

parseParamOptional

Determine if a parameter is optional.

Examples:
JSDoc: {Type} [name]
Google: {Type=} name
TypeScript: {Type?} name

方法 exports.parseParamOptional() exports parseParamOptional
参数 tag(Object)
返回 Boolean
可见度 public

parseCodeContext

Parse the context from the given str of js.

This method attempts to discover the context
for the comment based on it's code. Currently
supports:

  • function statements
  • function expressions
  • prototype methods
  • prototype properties
  • methods
  • properties
  • declarations
方法 exports.parseCodeContext() exports parseCodeContext
参数 str(String)
参数 parentContext(Object=) An indication if we are already in something. Like a namespace or an inline declaration.
返回 Object
可见度 public

utils: API索引


escape

Escape the given html.

方法 exports.escape() exports escape
参数 html(String)
返回 String
可见度 private