@@ -11,12 +11,12 @@ public class BuiltInTests(IModelAndRender renderer)
11
11
[ Theory ]
12
12
[ ClassData ( typeof ( BuiltInBasicData ) ) ]
13
13
public void HtmlBasicTypes ( string type )
14
- => RenderTypeHtml ( BuiltInData . BasicMap [ type ] , [ ] ) ;
14
+ => RenderTypeHtml ( "Basic" , BuiltInData . BasicMap [ type ] , [ ] ) ;
15
15
16
16
[ Theory ]
17
17
[ ClassData ( typeof ( BuiltInInternalData ) ) ]
18
18
public void HtmlInternalTypes ( string type )
19
- => RenderTypeHtml ( BuiltInData . InternalMap [ type ] , BuiltIn . Internal ) ;
19
+ => RenderTypeHtml ( "Internal" , BuiltInData . InternalMap [ type ] , BuiltIn . Internal ) ;
20
20
21
21
[ Fact ]
22
22
public void HtmlAllBasicTypes ( )
@@ -38,11 +38,14 @@ public void HtmlAllInternalTypes()
38
38
RenderSchemaHtml ( schema , "!Internal" ) ;
39
39
}
40
40
41
+ private readonly string [ ] _sections = [ "!Basic" , "!Internal" ] ;
42
+
41
43
[ Fact ]
42
44
public void Html_Index ( )
43
45
{
44
46
Structured result = new Map < Structured > ( ) {
45
47
[ "title" ] = "BuiltIn" ,
48
+ [ "items" ] = _sections . Render ( ) ,
46
49
[ "groups" ] = new Map < Structured > ( ) {
47
50
[ "Basic" ] = BuiltIn . Basic . Render ( t => t . Name ) ,
48
51
[ "Internal" ] = BuiltIn . Internal . Render ( t => t . Name ) ,
@@ -110,7 +113,7 @@ private void ModelType(IGqlpType type, IGqlpType[] extras)
110
113
context . Errors . ShouldBeEmpty ( type ? . Label ) ;
111
114
}
112
115
113
- private void RenderTypeHtml ( IGqlpType type , IGqlpType [ ] extras )
116
+ private void RenderTypeHtml ( string section , IGqlpType type , IGqlpType [ ] extras )
114
117
{
115
118
Assert . SkipWhen ( type is null , "type is null" ) ;
116
119
@@ -122,13 +125,13 @@ private void RenderTypeHtml(IGqlpType type, IGqlpType[] extras)
122
125
Declarations = [ .. extras . Where ( e => e != type ) ]
123
126
} ;
124
127
125
- RenderSchemaHtml ( schema , type . Name , extrasSchema ) ;
128
+ RenderSchemaHtml ( schema , type . Name , section , extrasSchema ) ;
126
129
}
127
130
128
- private void RenderSchemaHtml ( SchemaAst schema , string filename , SchemaAst ? extras = null )
131
+ private void RenderSchemaHtml ( SchemaAst schema , string filename , string section = "" , SchemaAst ? extras = null )
129
132
{
130
133
Structured result = renderer . RenderAst ( schema , renderer . Context ( ) , extras ) ;
131
134
132
- result . WriteHtmlFile ( "BuiltIn" , filename ) ;
135
+ result . WriteHtmlFile ( "BuiltIn" + section . Prefixed ( "/" ) , filename ) ;
133
136
}
134
137
}
0 commit comments