UNPKG

717 BJavaScriptView Raw
1var env = require('jsdoc/env'),
2 path = require('path'),
3 fs = require('fs'),
4 _ = require('underscore');
5
6exports.handlers = {
7 parseComplete: function (e) {
8 var src = env.opts._.map(function (src) { return path.join(env.pwd, src); }),
9 fd = fs.openSync(path.join(env.opts.destination, 'angular.jsdoc.search.data.js'), 'w'),
10 data;
11
12 data = e.doclets.filter(function(doclet) {
13 return !doclet.undocumented && doclet.kind !== 'member';
14 });
15
16 fs.writeSync(fd, 'angular.module("search").constant("SEARCH_DATA", ');
17 fs.writeSync(fd, JSON.stringify({ src: src, data: data }));
18 fs.writeSync(fd, ');');
19 fs.closeSync(fd);
20 }
21};