包详细信息

gulp-documentation

documentationjs1.9kBSD-2-Clause3.2.1

documentation plugin for gulp

documentation, gulp, gulpplugin, jsdoc

自述文件

gulp-documentation

Circle CI Greenkeeper badge

Use gulp with documentation to generate great documentation for your JavaScript projects.

Installation

$ npm install --save-dev gulp-documentation

API

documentation

Documentation stream intended for use within the gulp system.

Parameters

  • format string? format - one of 'html', 'md', or 'json' (optional, default md)
  • options Object documentation options - the same as given to documentation
    • options.filename string custom filename for md or json output
  • formatterOptions Object output options - same as given to documentation
    • formatterOptions.name Object if format is HTML, specifies the name of the project

Examples

var gulpDocumentation = require('gulp-documentation');
var gulp = require('gulp');
//  Out of the box, you can generate JSON, HTML, and Markdown documentation
gulp.task('documentation-readme-example', function () {
  // Generating README documentation
  return gulp.src('./index.js')
    .pipe(gulpDocumentation('md'))
    .pipe(gulp.dest('md-documentation'));
});

// Generating a pretty HTML documentation site
gulp.task('documentation-html-example', function () {
  return gulp.src('./index.js')
    .pipe(gulpDocumentation('html'))
    .pipe(gulp.dest('html-documentation'));
});

// Generating raw JSON documentation output
gulp.task('documentation-json-example', function () {
  return gulp.src('./index.js')
    .pipe(gulpDocumentation('json'))
    .pipe(gulp.dest('json-documentation'));
});

// Generate documentation for multiple files using normal glob syntax.
// Note that this generates one documentation output, so that it can
// easily cross-reference and use types.
gulp.task('documentation-multiple-files', function () {
  return gulp.src('./src/*.js')
    .pipe(gulpDocumentation('md'))
    .pipe(gulp.dest('md-documentation'));
});


// If you're using HTML documentation, you can specify additional 'name'
// and 'version' options
gulp.task('documentation-html-options', function () {
  return gulp.src('./src/*.js')
    .pipe(gulpDocumentation('html', {}, {
      name: 'My Project',
      version: '1.0.0'
    }))
    .pipe(gulp.dest('html-documentation'));
});

// Document non-JavaScript files with JSDoc comments using polyglot: true
gulp.task('documentation-for-cplusplus', function () {
  return gulp.src('./src/*.cpp')
    .pipe(gulpDocumentation('html', { polyglot: true }, {
      name: 'My Project',
      version: '1.0.0'
    }))
    .pipe(gulp.dest('html-documentation'));
});

Returns stream.Transform

更新日志

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

3.2.1 (2017-08-11)

Bug Fixes

  • package: update documentation to version 4.0.0-rc.0 (2e97196)

3.2.0 (2017-04-10)

Bug Fixes

  • docs: fix broken examples in code refs #20 (2cafc52)
  • docs: Fix straggling old-fashioned example (d213581)

Features

  • documentation: Update to documentation beta16, use conventional changelog (49ab102)

3.1.0 (2016-12-07)

Bug Fixes

  • docs: fix broken examples in code refs #20 (2cafc52), closes #20
  • docs: Fix straggling old-fashioned example (d213581)

Features

  • documentation: Update to documentation beta16, use conventional changelog (49ab102)

3.0.0

  • Updates documentation to v4.0.0-beta12
  • Removes ability to pass a documentation instance. This would not survive major version shifts.
  • Switches test framework from prova to tap
  • Removes generated documentation results from repo