forked from jsBoot/gulp-jsdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
103 lines (87 loc) · 2.06 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
(function(){
'use strict';
// Gulp
var gulp = require('gulp');
var gutil = require('gulp-util');
// Some basic linting
var eslint = require('gulp-eslint');
var jshint = require('gulp-jshint');
var jsreporter = require('jshint-stylish');
var fs = require('fs');
var jsconfig = JSON.parse(fs.readFileSync('./.jshintrc'));
var esconfig = JSON.parse(fs.readFileSync('./.eslintrc'));
gulp.task('lint', function(){
gulp.src([
'gulpfile.js',
'index.js',
'lib/**/*.js'
])
.pipe(gutil.combine(
eslint(esconfig),
eslint.format(),
jshint(jsconfig),
jshint.reporter(jsreporter)
)());
});
var template = require('gulp-template');
var jsdoc = require('./');
var pkg = require('./package.json');
var opts = {
showPrivate: true,
monospaceLinks: true,
cleverLinks: true,
outputSourceFiles: true
};
var tpl = {
path: 'ink-docstrap',
systemName : pkg.name,
footer : 'Generated with gulp',
copyright : 'Copyright WebItUp 2014',
navType : 'vertical',
theme : 'journal',
linenums : true,
collapseSymbols : false,
inverseNav : false
};
// Amelia
// Cerulean
// Cosmo
// Cyborg
// Flatly
// Journal
// Readable
// Simplex
// Slate
// Spacelab
// Spruce
// Superhero
// United
gulp.task('doc-simple', function() {
gulp.src([
'index.js',
'lib/**/*.js'
])
// Process source files first
.pipe(template({pkg: pkg}))
// Then process it
.pipe(jsdoc('./doc/jsdoc-simple'));
});
gulp.task('doc-inked', function() {
gulp.src([
'README.md',
'index.js',
'lib/**/*.js'
])
// Process source files first
.pipe(template({pkg: pkg}))
// Then parse
.pipe(jsdoc.parser(/*{
name: pkg.name,
description: pkg.description,
version: pkg.version,
licenses: pkg.licenses || [pkg.license]
}*/))
// Then generate the documentation and
.pipe(jsdoc.generator('./doc/jsdoc-inked', tpl, opts));
});
}());