@@ -66,6 +66,9 @@ export class DefaultTheme extends Theme {
6666 indexTemplate = ( pageEvent : PageEvent < ProjectReflection > ) => {
6767 return this . getRenderContext ( pageEvent ) . indexTemplate ( pageEvent ) ;
6868 } ;
69+ hierarchyTemplate = ( pageEvent : PageEvent < ProjectReflection > ) => {
70+ return this . getRenderContext ( pageEvent ) . hierarchyTemplate ( pageEvent ) ;
71+ } ;
6972 defaultLayoutTemplate = ( pageEvent : PageEvent < Reflection > , template : RenderTemplate < PageEvent < Reflection > > ) => {
7073 return this . getRenderContext ( pageEvent ) . defaultLayout ( template , pageEvent ) ;
7174 } ;
@@ -148,10 +151,14 @@ export class DefaultTheme extends Theme {
148151 urls . push ( new UrlMapping ( "index.html" , project , this . indexTemplate ) ) ;
149152 } else {
150153 project . url = "modules.html" ;
151- urls . push ( new UrlMapping < ContainerReflection > ( "modules.html" , project , this . reflectionTemplate ) ) ;
154+ urls . push ( new UrlMapping ( "modules.html" , project , this . reflectionTemplate ) ) ;
152155 urls . push ( new UrlMapping ( "index.html" , project , this . indexTemplate ) ) ;
153156 }
154157
158+ if ( includeHierarchyPage ( project ) ) {
159+ urls . push ( new UrlMapping ( "hierarchy.html" , project , this . hierarchyTemplate ) ) ;
160+ }
161+
155162 project . children ?. forEach ( ( child : Reflection ) => {
156163 if ( child instanceof DeclarationReflection ) {
157164 this . buildUrls ( child , urls ) ;
@@ -458,3 +465,17 @@ function shouldShowGroups(reflection: Reflection, opts: { includeCategories: boo
458465 }
459466 return reflection . comment ?. hasModifier ( "@showGroups" ) === true ;
460467}
468+
469+ function includeHierarchyPage ( project : ProjectReflection ) {
470+ for ( const id in project . reflections ) {
471+ const refl = project . reflections [ id ] as DeclarationReflection ;
472+
473+ if ( refl . kindOf ( ReflectionKind . ClassOrInterface ) ) {
474+ // Keep this condition in sync with the one in hierarchy.tsx for determining roots
475+ if ( ! ( refl . implementedTypes || refl . extendedTypes ) && ( refl . implementedBy || refl . extendedBy ) ) {
476+ return true ;
477+ }
478+ }
479+ }
480+ return false ;
481+ }
0 commit comments