-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
43 lines (42 loc) · 1.23 KB
/
Gruntfile.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
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
global.port = 8080
grunt.initConfig({
watch: {
all: {
options: {
livereload: 35353
},
files: ["<%= grunt.option(\"filename\") || 'index' %>.md"],
tasks: "shell:presentation:<%= grunt.option(\"filename\") %>"
}
},
connect: {
server: {
options: {
open: "http://localhost:<%= global.port %>/<%= grunt.option(\"filename\") || 'index' %>.html",
port: global.port,
livereload: 35353
}
}
},
shell: {
presentation: {
command: function (filename) {
if (!filename) {filename = grunt.option('filename') || 'index' };
console.log('building your presenation ' + filename + '.md')
return "node_modules/.bin/cleaver " + filename + '.md'
},
options: {
stdout: true
}
}
}
});
grunt.registerTask('build', 'watch and build presentation by filename', function(filename) {
if (!filename) {filename = 'index'};
grunt.option('filename', filename)
grunt.task.run('default')
})
grunt.registerTask('default', ['shell:presentation', 'connect:server', 'watch:all']);
}