MCPcopy
hub / github.com/jsdoc/jsdoc / buildMemberNav

Function buildMemberNav

templates/default/publish.js:302–332  ·  view source on GitHub ↗
(items, itemHeading, itemsSeen, linktoFn)

Source from the content-addressed store, hash-verified

300}
301
302function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
303 let nav = '';
304
305 if (items.length) {
306 let itemsNav = '';
307
308 items.forEach(item => {
309 let displayName;
310
311 if ( !hasOwnProp.call(item, 'longname') ) {
312 itemsNav += `<li>${linktoFn('', item.name)}</li>`;
313 }
314 else if ( !hasOwnProp.call(itemsSeen, item.longname) ) {
315 if (env.conf.templates.default.useLongnameInNav) {
316 displayName = item.longname;
317 } else {
318 displayName = item.name;
319 }
320 itemsNav += `<li>${linktoFn(item.longname, displayName.replace(/\b(module|event):/g, ''))}</li>`;
321
322 itemsSeen[item.longname] = true;
323 }
324 });
325
326 if (itemsNav !== '') {
327 nav += `<h3>${itemHeading}</h3><ul>${itemsNav}</ul>`;
328 }
329 }
330
331 return nav;
332}
333
334function linktoTutorial(longName, name) {
335 return tutoriallink(name);

Callers 1

buildNavFunction · 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…