forked from bitfragment/mindoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
103 lines (97 loc) · 2.92 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
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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
gruntfile: {
src: 'Gruntfile.js'
},
watch: {
gruntfile: {
files: ['src/**/*', 'tests/*'],
tasks: ['default']
}
},
version: {
options: {
prefix: 'mindoc</a>\\sv'
},
src: ['src/mindoc-pandoc.html']
},
concat: {
jsSrc: {
options: {
banner: "// # mindoc.js\n\n// GitHub: [https://bitfragment.github.io/mindoc](https://bitfragment.github.io/mindoc)\n\n",
},
// src: 'src/js/*.js', // If order doesn't matter
src: [ // If order matters
'src/js/moduleBegin.js',
'src/js/pandoc.js',
'src/js/dom.js',
'src/js/nav.js',
'src/js/main.js',
'src/js/moduleEnd.js',
'src/js/load.js'
],
dest: 'build/mindoc.js'
}
},
inline: {
dist: {
options: {
cssmin: true,
uglify: true
},
src: 'src/mindoc-pandoc.html',
dest: 'dist/mindoc-pandoc.html'
}
},
panda: {
options: {
pandocOptions: [
'--template=dist/mindoc-pandoc.html',
'--to=html5', // Example output HTML in dist/ should be HTML5
'--section-divs',
'--smart',
'--variable=lang:en',
'--variable=description:<%= pkg.description %>'
]
},
main: {
src: 'src/mindoc.md',
dest: 'dist/mindoc.html'
},
ghpages: { // Create ./index.html for GitHub Pages
src: 'src/mindoc.md',
dest: './index.html'
},
blank: {
src: 'src/mindoc-blank.md',
dest: 'dist/mindoc-blank.html'
}
},
docco: {
all: {
src: ['build/mindoc.js'],
options: {
output: 'docs/',
layout: 'linear'
}
}
}
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-version');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-inline');
grunt.loadNpmTasks('grunt-panda');
grunt.loadNpmTasks('grunt-docco');
// Default task
grunt.registerTask('default',
[
'version',
'concat',
'inline',
'panda',
'docco'
]);
};