MCPcopy Create free account
hub / github.com/SoftwareBrothers/better-docs / attachModuleSymbols

Function attachModuleSymbols

publish.js:287–315  ·  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

285 * @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
286 */
287function attachModuleSymbols(doclets, modules) {
288 var symbols = {}
289
290 // build a lookup table
291 doclets.forEach(function(symbol) {
292 symbols[symbol.longname] = symbols[symbol.longname] || []
293 symbols[symbol.longname].push(symbol)
294 })
295
296 modules.forEach(function(module) {
297 if (symbols[module.longname]) {
298 module.modules = symbols[module.longname]
299 // Only show symbols that have a description. Make an exception for classes, because
300 // we want to show the constructor-signature heading no matter what.
301 .filter(function(symbol) {
302 return symbol.description || symbol.kind === 'class'
303 })
304 .map(function(symbol) {
305 symbol = doop(symbol)
306
307 if (symbol.kind === 'class' || symbol.kind === 'function') {
308 symbol.name = symbol.name.replace('module:', '(require("') + '"))'
309 }
310
311 return symbol
312 })
313 }
314 })
315}
316
317function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
318 const subCategories = items.reduce((memo, item) => {

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…