Repository navigation
Expand file tree
/
Copy pathGruntfile.js
More file actions
60 lines (50 loc) · 1.49 KB
/
Copy pathGruntfile.js
File metadata and controls
60 lines (50 loc) · 1.49 KB
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
var raml2boot = require('./lib');
module.exports = function(grunt) {
grunt.initConfig({
bump: {
options: {
files: [ 'package.json' ],
commit: false,
createTag: false,
push: false
}
},
clean: {
pages: [ 'tmp/pages/**/*' ]
},
'gh-pages': {
options: {
base: 'tmp/pages'
},
src: ['**']
},
jshint: {
files: [ 'Gruntfile.js', 'lib/**/*.js' ]
},
watch: {
examples: {
files: [ 'examples/**/*.raml', 'examples/**/*.jade', 'lib/**/*.js', 'templates/**/*' ],
tasks: [ 'examples' ],
options: {
atBegin: true,
livereload: true
}
}
}
});
grunt.registerTask('examples', 'Convert examples/api.raml to examples/api.html', function() {
var done = this.async();
raml2boot({ source: 'examples/api.raml', output: 'examples/api.html', livereload: true }).then(done);
});
grunt.registerTask('convertForPages', 'Convert examples/api.raml for GitHub Pages', function() {
var done = this.async();
raml2boot({ source: 'examples/api.raml', output: 'tmp/pages/index.html' }).then(done);
});
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.registerTask('default', [ 'jshint' ]);
grunt.registerTask('pages', [ 'clean:pages', 'convertForPages', 'gh-pages' ]);
};