NOTICE
Project maintenance is currently on ice while i develop the vastly superior jsdoc-to-markdown, please consider using that instead.
yuidoc2md
A markdown generator for yuidoc documentation.
Install
$ npm install -g yuidoc2md
Linux/Mac users may need to run the above with sudo
Usage
Usage:$ yuidoc2md [options] <files> -t, --template A handlebars template filename to override the default-j, --json Output json-h, --help Print this help
Output markdown doc for all source under src/
to stdout
:
$ yuidoc2md src/*
Globstar matching is supported, enabling recursive expressions like: (processes all .js files from the current directory down)
$ yuidoc2md "**/*.js"
Output markdown doc for all source under src/
to a file:
$ yuidoc2md src/* > documentation.md
Generate using your own handlebars template:
$ yuidoc2md src/* --template mytemplate.hbs
Generate html using marked:
$ yuidoc2md src/* | marked
Generate JSON
$ yuidoc2md src/* --json
Example
Running yuidoc2md on this Javascript:
/**@module form*/ /**The description for ComboBox@class ComboBox@extends Object@uses clive.txt@uses hater.txt@constructor@param arg1 @param arg2 */{ /** @property someProp @type String @default "whatever" @example this.someProp = "val"; */ thissomeProp = "whatever";} /**@method methodA@param@param@return @chainable*/ComboBoxprototype{}; /**@method methodB@param @param @param@return */ComboBoxprototype{};
would produce this markdown:
#form/ComboBox The description for ComboBox **Extends**: Object **Uses**: * clive.txt* hater.txt ##Properties ###someProp **type**: String **default**: "whatever" ####Example this.someProp = "val"; ##Methods ###methodA **Chainable**: true **Returns**: _Number_ - return val **Params**: * str _String_ A string* num _Number_ A number ###methodB **Returns**: _Boolean_ - return val **Params**: * options _Object_ An options hash * one _String_ - First thing * two _Number_ - Second thing
and this json: