• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

documentationjs/gulp-documentation: Use gulp with documentation to generate grea ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

documentationjs/gulp-documentation

开源软件地址(OpenSource Url):

https://github.com/documentationjs/gulp-documentation

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap