Skip to content

Commit dee6c72

Browse files
committed
now examples can handle more data than file and title
1 parent 3c05e97 commit dee6c72

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Diff for: examples/basics/details.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"file": "01+-+load+an+image.js",
4+
"title": "01 - load an image",
5+
"jsbin":"http://jsbin.com/zagob/1/edit?js,output"
6+
},
7+
{
8+
"file": "02+-+click+on+an+image.js",
9+
"title": "02 - click on an image",
10+
"jsbin":"http://jsbin.com/zagob/6/edit?js,output"
11+
},
12+
{
13+
"file": "03+-+move+an+image.js",
14+
"title": "03 - move an image",
15+
"jsbin":"http://jsbin.com/zagob/7/edit?js,output"
16+
},
17+
{
18+
"file": "04+-+image+follow+input.js",
19+
"title": "04 - image follow input",
20+
"jsbin":"http://jsbin.com/zagob/9/edit?js,output"
21+
},
22+
{
23+
"file": "05+-+load+an+animation.js",
24+
"title": "05 - load an animation",
25+
"jsbin":"http://jsbin.com/zagob/10/edit?js,output"
26+
},
27+
{
28+
"file": "06+-+render+text.js",
29+
"title": "06 - render text",
30+
"jsbin":"http://jsbin.com/zagob/11/edit?js,output"
31+
}
32+
]

Diff for: tasks/examples.js

+8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ module.exports = function(grunt) {
7272
});
7373
}
7474

75+
for(var _name in results){
76+
try{
77+
var fileJSON = require('../'+options.base+'/'+_name+'/details.json');
78+
_.merge(results[_name], fileJSON);
79+
}catch(e){}
80+
}
81+
82+
7583
grunt.verbose.writeln();
7684
grunt.verbose.or.write('Writing ' + f.dest + '...');
7785
grunt.file.write(f.dest, JSON.stringify(results, null, ' '));

0 commit comments

Comments
 (0)