coffeedoc.coffee

Documentation functions

These functions extract relevant documentation info from AST nodes as returned by the coffeescript parser.

Functions

Given a module's source code and an AST parser, returns module information in the form:

{
    "docstring": "Module docstring",
    "classes": [class1, class1...],
    "functions": [func1, func2...]
}

AST parsers are defined in the parsers.coffee module

Evaluates a class object as returned by the coffeescript parser, returning an object of the form:

{
    "name": "MyClass",
    "docstring": "First comment following the class definition"
    "parent": "MySuperClass",
    "methods": [method1, method2...]
}

Evaluates a function object as returned by the coffeescript parser, returning an object of the form:

{
    "name": "myFunc",
    "docstring": "First comment following the function definition",
    "params": ["param1", "param2"...]
}

Given a string, returns it with leading whitespace removed but with indentation preserved. Replaces \# with # to allow for the use of multiple # characters in markup languages (e.g. Markdown headers)