tomdoc

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i tomdoc

Weekly Downloads

0

Version

0.0.2

License

none

Last publish

Collaborators

  • benogle