-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.js
36 lines (31 loc) · 1.06 KB
/
generate.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
var searchMapHash = require("./generators/search-map-hash"),
searchMap = require("./generators/search-map"),
Q = require("q");
/**
* @function bitDocs.generators.searchMap.generate
* @parent bitDocs.generators.searchMap.methods
*
* Generates a searchMap based on the [documentjs.process.docMap docMap]
* given the docMap and the configuration siteConfig.
*
* @signature `.generate(docMapPromise, siteConfig)`
*
* @param {Promise<documentjs.process.docMap>} docMapPromise A promise that
* contains a `docMap` created by [documentjs.process.files].
* @param {Object} siteConfig Configuration siteConfig.
*
* @return {Promise} A promise that resolves when the site has been built.
*/
module.exports = function(docMapPromise, siteConfig){
var searchMapPromise = docMapPromise.then(function(docMap){
return searchMap(docMap, siteConfig);
});
var searchMapHashPromise = searchMapPromise.then(function(searchMap){
return searchMapHash(searchMap, siteConfig);
});
return docsPromise = Q.all([
docMapPromise,
searchMapPromise,
searchMapHashPromise
]);
};