locco
Simple documentation extractor.
Usage
locco --adapter=markdown --source=**/*.js --commentStart=// \ --escapeSequence=! --adapter-readme=locco.js
adapter
: The adapter to be used. Locco searches for adapter matching thelocco-<name>
pattern. Install markdown adapter withnpm install -g locco-markdown
source
: The glob pattern matching the files to be parsed.- optional
commentStart
: Start of the comment line. Defaults to//
- optional
escapeSequence
: Characters that right after the start of comment indicate that the comment is not documentation. - dependant on adapter
adapter-<property>
: option sent to the adapter
Or programmatically:
var locco = var loccoMarkdown =
Installation
npm install -g locco
Then you need to install some adapter for it or add your own.
Adapters
Look for NPMs starting with locco-
.
Known adapters
Writing an adapter
To just log each line to the console:
var locco = ; var loggerAdapter = { console console } { console console }
If you want to write to a file, the adapter should
implement the event emitter interface (use
Mediador if you don't know how
to implement one) and emit post
events with each line to be
written.
var locco = var Mediador = var loggerAdapter = { console console this } { console console this } loggerAdapteron = MediadorprototypeonloggerAdapteroff = MediadorprototypeoffloggerAdapteremit = Mediadorprototypeemit
License
Copyright 2014 Xavier Via
ISC license.
See LICENSE attached.