Skip to content

isabella232/tomdoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TomDoc parser

Parse tomdoc with JavaScript / CoffeeScript.

This library is no longer maintained.

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

About

Parse tomdoc with JS / Coffee *no longer maintained*

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 100.0%