tomdoc
v0.0.2
Published
A TomDoc parser
Downloads
2
Readme
TomDoc parser
Parse tomdoc with JavaScript / CoffeeScript.
Usage
It's on npm
npm install tomdoc
It only has one method, parse
, that takes no options.
TomDoc = require 'tomdoc'
docString = """
Public: My awesome method that does stuff.
It does things and stuff and even more things, this is the description.
count - an {Int} representing count
callback - a {Function} that will be called when finished
Returns a {Bool}; true when it does the thing
"""
doc = TomDoc.parse(docString)
doc
will be an object:
{
status: 'Public',
summary: 'My awesome method that does stuff.'
description: 'My awesome method that does stuff.\nIt does things and stuff and even more things, this is the description.',
arguments: [{
name: 'count',
description: 'an {Int} representing count',
type: 'Int'
}, {
name: 'callback',
description: 'a {Function} that will be called when finished',
type: 'Function'
}],
returnValue: [{
type: 'Bool',
description: 'Returns a {Bool}; true when it does the thing'
}],
originalText: """
Public: My awesome method that does stuff.
It does things and stuff and even more things, this is the description.
count - an {Int} representing count
callback - a {Function} that will be called when finished
Returns a {Bool}; true when it does the thing
"""
}
The parser was pulled out of biscotto