Class: Doc

Defined in: src/nodes/doc.coffee
Inherits: Node

Overview

A documentation node is responsible for parsing

Instance Method Summary

Inherited Method Summary

Methods inherited from Node

.findAncestor

Constructor Details

.constructor(node, options) Source

Construct a documentation

Parameters:

  • nodethe comment node (a [Object])
  • optionsthe parser options (a [Object])

Instance Method Details

.deindent(lines) Source

.hasComment() Source

Determines if the current doc has some comments

Returns:

  • Returns the comment status (a [Boolean])

.leftTrimBlock(lines) Source

Detect whitespace on the left and removes

Examples:

Parameters:

  • linesThe comment lines [[String]]

.parseBlock(lines) Source

Parse the given lines as TomDoc and adds the result

.parse_arguments(section) Source

Parse arguments section. Arguments occur subsequent to

Parameters:

  • sectionString containing agument definitions.

Returns:

  • Returns nothing.

.parse_description(section) Source

Parse description.

Parameters:

  • sectionString containing description.

Returns:

  • Returns nothing.

.parse_examples(section, sections) Source

Parse examples.

Parameters:

  • sectionString starting with Examples.
  • sectionsAll sections subsequent to section.

Returns:

  • Returns nothing.

.parse_returns(section) Source

Parse returns section.

Parameters:

  • sectionString containing Returns lines.

Returns:

  • Returns nothing.

.toJSON() Source

Get a JSON representation of the object

Returns:

  • Returns the JSON object (a [Object])