toga

The streaming documentation generator.

toga

One tool and one destination for all project documentation including user guides, developer guides, styleguides, and api documentation for both front and back-end technologies. Source code for an entire project is streamed into documentation via Transform Streams a la gulp.

Module:

$ npm install --save-dev toga

CLI:

$ npm install --global toga
Usage: toga [options]
 
Options:
  -c, --config   Specify configuration file [togafile.js]
  -d, --cwd      Specify working directory [.]
  -h, --help     Show help
  -v, --version  Show version number
var toga = require('toga'); // Loads toga. 
 
toga.src(files);        // Just `require('vinyl-fs').src`. 
toga.dest(directory);   // Just `require('vinyl-fs').dest`. 
 
toga.map(callback);     // Turns a map function into a transform stream. 
toga.merge(...streams); // Merges multiple readable streams into one. 
toga.push(...streams);  // Pushes objects from a readable stream into a duplex. 
var toga = require('toga'),
    css = require('toga-css'),
    js = require('toga-js'),
    md = require('toga-markdown'),
    pura = require('toga-pura'),
 
    config = {
        src: [
            './src/docs/**/*.md',
            './src/assets/**/*.css',
            './src/assets/**/*.js'
        ],
        dest: './web/docs'
    };
 
toga
    .src(config.src)
    .pipe(css.parser())
    .pipe(js.parser())
    .pipe(md.formatter())
    .pipe(pura.compiler())
    .pipe(toga.dest(config.dest));
var toga = require('toga'),
    css = require('toga-css'),
    js = require('toga-js'),
    perl = require('toga-perl'),
    md = require('toga-markdown'),
    sample = require('toga-sample'),
    pod = require('toga-pod'),
    pura = require('toga-pura'),
 
    config = {
        manual: './src/assets/**/*.md',
        css: './src/assets/**/*.css',
        js: './src/assets/**/*.js',
        perl: './lib/**/*.{pl,pm}',
        dest: './web/docs'
    },
 
    manual = toga
        .src(config.manual)
        .pipe(md.parser())
        .pipe(md.formatter()),
 
    client = toga
        .src(config.css)
        .pipe(css.parser())
        .pipe(js.parser())
        .pipe(sample.formatter())
        .pipe(md.formatter()),
 
    server = toga
        .src(config.perl)
        .pipe(perl.parser())
        .pipe(pod.formatter());
 
toga
    .merge(manual, client, server)
    .pipe(pura.compiler())
    .pipe(toga.dest(config.dest));

Standards for this project, including tests, code coverage, and semantics are enforced with a build tool. Pull requests must include passing tests with 100% code coverage and no linting errors.

$ npm test

© 2015 Shannon Moeller me@shannonmoeller.com

Licensed under MIT