MCPcopy Index your code
hub / github.com/stdlib-js/stdlib / attachModuleSymbols

Function attachModuleSymbols

tools/docs/jsdoc/templates/html/publish.js:262–290  ·  view source on GitHub ↗

* Look for classes or functions with the same name as modules (which indicates that the module * exports only that class or function), then attach the classes or functions to the `module` * property of the appropriate module doclets. The name of each class or function is also updated * for displa

(doclets, modules)

Source from the content-addressed store, hash-verified

260 * @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
261 */
262function attachModuleSymbols(doclets, modules) {
263 var symbols = {};
264
265 // build a lookup table
266 doclets.forEach(function(symbol) {
267 symbols[symbol.longname] = symbols[symbol.longname] || [];
268 symbols[symbol.longname].push(symbol);
269 });
270
271 return modules.map(function(module) {
272 if (symbols[module.longname]) {
273 module.modules = symbols[module.longname]
274 // Only show symbols that have a description. Make an exception for classes, because
275 // we want to show the constructor-signature heading no matter what.
276 .filter(function(symbol) {
277 return symbol.description || symbol.kind === 'class';
278 })
279 .map(function(symbol) {
280 symbol = doop(symbol);
281
282 if (symbol.kind === 'class' || symbol.kind === 'function') {
283 symbol.name = symbol.name.replace('module:', '(require("') + '"))';
284 }
285
286 return symbol;
287 });
288 }
289 });
290}
291
292function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
293 var nav = '';

Callers 1

publish.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…