docr

0.0.6 • Public • Published

docr

Small javascript to markdown documentation tool

usage

npm install -g docr
 
docr file|pattern [ file|pattern] [--prepend file] [--append file] [--intro]
  pattern    Linux will expand wildcards so remember to escape
             them "\*"
  prepend    can be repeated many times
  append     can be repeated many times
  intro      if the file has an intro (comment at the very
             beginning of the file) it will be used

Documentation will be printed to stdout.

examples

# multiple files 
docr index.js lib/xxx.js
 
# globbing support 
docr lib/*

File compatibility

docr is very simple. Do not support prototype or even objects. It's made some modules i have that has recursive require(s).

As you may know, when you have recursive require the easiest way to solve it is to write you module like this.

module.exports = {
    power: power
}
 
function _private_function() {
    // this function won't be documented because starts with "_"
}
 
/**
 * Give me some power!
 *
 * @param {Number} a 
 * @param {Number} b 
 * @return {Number} 
 */
function power(a, b) {
    return Math.power(a, b);
}

docr will generate documentation for any function that has a doc-block. To be coherent function name must be the same as exports.

jsDoc support.

  • description
  • @param
  • @note
  • @return
  • @example (partial support)

new

  • @name String

    Force the function name in the documentation.

projects that use docr

Readme

Keywords

Package Sidebar

Install

npm i docr

Weekly Downloads

3

Version

0.0.6

License

MIT

Last publish

Collaborators

  • llafuente