-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-example.js
50 lines (47 loc) · 1.53 KB
/
make-example.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 generate = require("bit-docs-generate-html/generate");
var generateSearchMap = require("bit-docs-generate-searchmap/generate");
var Q = require("q");
var fs = require("fs");
var readFile = Q.denodeify(fs.readFile);
var path = require("path");
var forceBuild = process.argv.indexOf("-f") !== -1;
var docMap = readFile(__dirname+"/docMap.json").then(function(source){
return JSON.parse(""+source);
});
var siteConfig = {
html: {
templates: path.join(__dirname, "templates"),
package: {
steal: {
configDependencies: [
"./node_modules/steal-conditional/conditional"
]
}
},
dependencies: {
"bit-docs-html-canjs": __dirname,
"bit-docs-prettify": "^0.3.0",
"bit-docs-html-highlight-line": "^0.5.3",
//TODO: This should not be include here and should only be included in package.json.
// we get an error without this, here, though
"steal-stache": "^4.0.1",
"steal-conditional": "^0.3.6",
"bit-docs-html-codepen-link": "^2.0.0",
"bit-docs-html-toc": "^1.1.1"
},
staticDist: [
path.join(__dirname, "dist", "static")
]
},
dest: path.join(__dirname, "doc"),
parent: "canjs",
forceBuild: forceBuild,
minifyBuild: false,
altVersions: {
"2.3.27": "https://v2.canjs.com"
},
debug: true
};
generate(docMap,siteConfig).then(function(){
return generateSearchMap(docMap, siteConfig);
}).done();