Skip to content

Commit 4094275

Browse files
committed
allow usage of custom instance
1 parent 76d99df commit 4094275

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

index.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
var through2 = require('through2'),
2-
File = require('vinyl'),
3-
documentation = require('documentation');
2+
File = require('vinyl');
43

54
/**
65
* Documentation stream intended for use within the gulp system.
@@ -39,9 +38,26 @@ var through2 = require('through2'),
3938
* }))
4039
* .pipe(gulp.dest('documentation'));
4140
* });
41+
*
42+
*
43+
* // documentation with JSON output, default filename API.md and custom Documentation instance
44+
* var documentation = require('gulp-documentation'),
45+
* $documentation = require('documentation');
46+
*
47+
*
48+
* gulp.task('documentation-json', function () {
49+
* gulp.src('./index.js')
50+
* .pipe(documentation({
51+
* format: 'json'
52+
* }, $documentation))
53+
* .pipe(gulp.dest('documentation'));
54+
* });
55+
*
4256
*/
43-
module.exports = function (options) {
57+
module.exports = function (options, documentation) {
4458
options = options || {};
59+
documentation = documentation || require('documentation');
60+
4561
var docOptions = {
4662
github : !!(options.github || options.g),
4763
shallow: options.shallow || false

0 commit comments

Comments
 (0)