Class Doc
Defined in: | src/nodes/doc.coffee |
Inherits: | Node |
Overview
Public: A documentation node is responsible for parsing
the comments for known tags.
Instance Method Summary
- ::constructor(node, options) Construct a documentation node.
- Boolean ::hasComment() Determines if the current doc has some comments
- Boolean ::isInternal() Is this doc internal?
- Boolean ::isPrivate() Is this doc private?
- Boolean ::isPublic() Is this doc public?
- ::leftTrimBlock(lines) Detect whitespace on the left and removes the minimum whitespace amount.
- ::parseBlock(lines) Parse the given lines as TomDoc and adds the result to the result object.
- ::parse_arguments(section) Parse the member's arguments.
- ::parse_description(section) Parse the member description.
- ::parse_examples(section, sections) Parse the member examples.
- ::parse_returns(section) Parse the member's return values.
- Object ::toJSON() Get a JSON representation of the object.
Inherited Method Summary
Methods inherited from Node
Constructor Details
Instance Method Details
Boolean ::hasComment() Source
Public: Determines if the current doc has some comments
Returns the comment status (a Boolean).
::leftTrimBlock(lines) Source
Public: Detect whitespace on the left and removes
the minimum whitespace amount.
lines - The comment lines [String]
Examples
leftTrimBlock(['', ' Escape at maximum speed.', '', ' @param (see #move)', ' '])
=> ['', 'Escape at maximum speed.', '', '@param (see #move)', '']
This will keep indention for examples intact.
Returns the left trimmed lines as an Array of Strings.
Examples:
leftTrimBlock(['', ' Escape at maximum speed.', '', ' @param (see #move)', ' '])
=> ['', 'Escape at maximum speed.', '', '@param (see #move)', '']
::parseBlock(lines) Source
Public: Parse the given lines as TomDoc and adds the result
to the result object.
::parse_arguments(section) Source
Public: Parse the member's arguments. Arguments occur subsequent to
the description.
section - A String containing the argument definitions.
Returns nothing.
::parse_description(section) Source
Public: Parse the member description.
section - The section String containing a description.
Returns nothing.
::parse_examples(section, sections) Source
Public: Parse the member examples.
section - The section String starting with "Examples"
sections - All sections subsequent to `section`.
Returns nothing.