bin/theme.js
function build(hasSeparateGlobals) {
                    var root = new output.NavigationItem('Index', 'index.html');
                    if (entryPoint == project) {
                        var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
                        globals.isGlobals = true;
                    }
                    var modules = [];
                    project.getReflectionsByKind(td.models.ReflectionKind.SomeModule).forEach(function (someModule) {
                        var target = someModule.parent;
                        var inScope = (someModule == entryPoint);
                        while (target) {
                            if (target.kindOf(td.models.ReflectionKind.ExternalModule))
                                return;
                            if (entryPoint == target)
                                inScope = true;
                            target = target.parent;
                        }
                        if (inScope) {
                            modules.push(someModule);
                        }
                    });
                    if (modules.length < 10) {
                        buildGroups(modules, root);
                    }
                    else {
                        buildGroups(entryPoint.getChildrenByKind(td.models.ReflectionKind.SomeModule), root, buildChildren);
                    }
                    return root;
                }
function build(hasSeparateGlobals) {
                    var root = new output.NavigationItem('Index', 'index.html');
                    if (entryPoint == project) {
                        var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
                        globals.isGlobals = true;
                    }
                    var modules = [];
                    project.getReflectionsByKind(td.models.ReflectionKind.SomeModule).forEach(function (someModule) {
                        var target = someModule.parent;
                        var inScope = (someModule == entryPoint);
                        while (target) {
                            if (target.kindOf(td.models.ReflectionKind.ExternalModule))
                                return;
                            if (entryPoint == target)
                                inScope = true;
                            target = target.parent;
                        }
                        if (inScope) {
                            modules.push(someModule);
                        }
                    });
                    if (modules.length < 10) {
                        buildGroups(modules, root);
                    }
                    else {
                        buildGroups(entryPoint.getChildrenByKind(td.models.ReflectionKind.SomeModule), root, buildChildren);
                    }
                    return root;
                }
function build ( hasSeparateGlobals ) { var root = new output . NavigationItem ( 'Index' , 'index.html' ) ; if ( entryPoint == project ) { var globals = new output . NavigationItem ( 'Globals' , hasSeparateGlobals ? 'globals.html' : 'index.html' , root ) ; globals . isGlobals = true ; } var modules = [ ] ; project . getReflectionsByKind ( td . models . ReflectionKind . SomeModule ) . forEach ( function ( someModule ) { var target = someModule . parent ; var inScope = ( someModule == entryPoint ) ; while ( target ) { if ( target . kindOf ( td . models . ReflectionKind . ExternalModule ) ) return ; if ( entryPoint == target ) inScope = true ; target = target . parent ; } if ( inScope ) { modules . push ( someModule ) ; } } ) ; if ( modules . length < 10 ) { buildGroups ( modules , root ) ; } else { buildGroups ( entryPoint . getChildrenByKind ( td . models . ReflectionKind . SomeModule ) , root , buildChildren ) ; } return root ; }
Build the navigation structure.

@param hasSeparateGlobals  Has the project a separated globals.html file?
@return                    The root node of the generated navigation structure.
Build the navigation structure .