-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
50 lines (41 loc) · 1.14 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
var glob = require("glob")
module.exports = function(grunt) {
// load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
grunt.initConfig({
hercule: {
docs: {
src: 'path/to/your/blueprint.md',
dest: 'path/to/dest.md'
}
},
aglio: {
docs:{
files:{
"public/index.html": ["src/docs/section1.md", "src/docs/section2.md"]
},
options: {
theme: "slate"
}
}
}
});
grunt.registerTask('build', function(api) {
if (api) {
var htmlDocFile = 'public/' + api + '.html';
var compiledMarkdownFile = 'docs/' + api + '.md';
var blueprintFile = api + '/' + api + '.apib';
glob("docs/**/*.md", function (er, files) {
grunt.config('aglio.docs.files', {
"public/index.html": files
});
});
grunt.config('hercule.docs.src', blueprintFile);
grunt.config('hercule.docs.dest', compiledMarkdownFile);
}
grunt.task.run('hercule');
grunt.task.run('aglio');
});
// run grunt build:<api name>
grunt.registerTask('default', ['build']);
};