Skip to content
cloakedcode edited this page Jul 4, 2011 · 4 revisions

Parser

Parses code and spits out block comments, nicely broken down.

See

parseComments

parseFile

parseFile(self, file)

Parse comments in the given file.

Parameters

file String Path of file.

Returns

Array

See

parseComments

MarkdownTemplate::renderComments

parseComments

parseComments(self, str)

Parse comments in the given code.

Parameters

str String String to parse.

Returns

Array

See

parseComment

parseComment

parseComment(self, s)

Parse the given comment s.

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

Parameters

s String

Returns

Dictionary

See

parseTag

parseTag

parseTag(self, str)

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

Parameters

str String

Returns

Dictionary

parseTagTypes

parseTagTypes(self, str)

Parse tag type string "{Array|Object}" etc.

Parameters

str String

Returns

Array

parseCodeContext

parseCodeContext(self, str)

Parse the context from the given str of code.

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

Parameters

str String

Returns

Dictionary

MarkdownTemplate

Turns comments into markdown.

renderComments

renderComments(self, comments)

Renders a bunch of comments as markdown.