0

In jsdoc default template, nav bar is constructed in publish.js buildNav function.

e.g.

nav += buildMemberNav(members.events, 'Events', seen, linkto);

However, there's no members.functions.

I'd like to know how to list all the functions (under every Namespace, class) in the nav bar.

shrekshao
  • 388
  • 4
  • 12

1 Answers1

1

I find a template https://github.com/nijikokun/minami/blob/master/publish.js#L298-L333 , where they create a sub list of methods for each class, as the reference.

Say, if we want to list all the functions under every namespace in the nav bar, we can have the following code to add the related html

var methods = find({kind:'function', memberof: item.longname}); 

item here in our case, is member.namespace

if (methods.length) {
    itemsNav += "<ul class='methods'>";
    methods.forEach(function (method) {
        itemsNav += "<li data-type='method'>";
        itemsNav += linkto(method.longname, method.name);
        itemsNav += "</li>";
    });
    itemsNav += "</ul>";
}
shrekshao
  • 388
  • 4
  • 12