Skip to content

Commit 3b09bec

Browse files
Remove "Globals" from navigation if entry point is specified
1 parent 1d742ba commit 3b09bec

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ in order to change the behaviour of TypeDoc.
9191
Set the Google Analytics tracking ID and activate tracking code.
9292
* `--gaSite <site>`<br>
9393
Set the site name for Google Analytics. Defaults to `auto`
94+
* `--entryPoint <fully.qualified.name>`<br>
95+
Specifies the fully qualified name of the root symbol. Defaults to global namespace.
9496

9597
#### Content
9698
* `--includes <path/to/includes>`<br>

bin/typedoc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8145,8 +8145,10 @@ var td;
81458145
*/
81468146
function build(hasSeparateGlobals) {
81478147
var root = new output.NavigationItem('Index', 'index.html');
8148-
var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
8149-
globals.isGlobals = true;
8148+
if (entryPoint == project) {
8149+
var globals = new output.NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
8150+
globals.isGlobals = true;
8151+
}
81508152
var modules = [];
81518153
project.getReflectionsByKind(td.models.ReflectionKind.SomeModule).forEach(function (someModule) {
81528154
var target = someModule.parent;
@@ -8163,7 +8165,7 @@ var td;
81638165
}
81648166
});
81658167
if (modules.length < 10) {
8166-
buildGroups(modules, root, buildChildren);
8168+
buildGroups(modules, root);
81678169
}
81688170
else {
81698171
buildGroups(entryPoint.getChildrenByKind(td.models.ReflectionKind.SomeModule), root, buildChildren);

src/td/output/themes/DefaultTheme.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,11 @@ module td.output
308308
*/
309309
function build(hasSeparateGlobals:boolean):NavigationItem {
310310
var root = new NavigationItem('Index', 'index.html');
311-
var globals = new NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
312-
globals.isGlobals = true;
311+
312+
if (entryPoint == project) {
313+
var globals = new NavigationItem('Globals', hasSeparateGlobals ? 'globals.html' : 'index.html', root);
314+
globals.isGlobals = true;
315+
}
313316

314317
var modules = [];
315318
project.getReflectionsByKind(models.ReflectionKind.SomeModule).forEach((someModule) => {
@@ -327,7 +330,7 @@ module td.output
327330
});
328331

329332
if (modules.length < 10) {
330-
buildGroups(modules, root, buildChildren);
333+
buildGroups(modules, root);
331334
} else {
332335
buildGroups(entryPoint.getChildrenByKind(models.ReflectionKind.SomeModule), root, buildChildren);
333336
}

0 commit comments

Comments
 (0)