@@ -36,12 +36,13 @@ public DocumentationGroup(
3636 IReadOnlyCollection < ITocItem > toc ,
3737 IDictionary < string , DocumentationFile > lookup ,
3838 IDictionary < string , DocumentationFile [ ] > folderLookup ,
39+ ref int fileIndex ,
3940 int depth = 0 ,
4041 MarkdownFile ? index = null
4142 )
4243 {
4344 Depth = depth ;
44- Index = ProcessTocItems ( index , toc , lookup , folderLookup , depth , out var groups , out var files , out var navigationItems ) ;
45+ Index = ProcessTocItems ( index , toc , lookup , folderLookup , depth , ref fileIndex , out var groups , out var files , out var navigationItems ) ;
4546
4647 GroupsInOrder = groups ;
4748 FilesInOrder = files ;
@@ -59,6 +60,7 @@ public DocumentationGroup(
5960 IDictionary < string , DocumentationFile > lookup ,
6061 IDictionary < string , DocumentationFile [ ] > folderLookup ,
6162 int depth ,
63+ ref int fileIndex ,
6264 out List < DocumentationGroup > groups ,
6365 out List < MarkdownFile > files ,
6466 out List < INavigationItem > navigationItems )
@@ -75,10 +77,11 @@ public DocumentationGroup(
7577 continue ;
7678
7779 md . Parent = this ;
80+ md . NavigationIndex = ++ fileIndex ;
7881
7982 if ( file . Children . Count > 0 && d is MarkdownFile virtualIndex )
8083 {
81- var group = new DocumentationGroup ( file . Children , lookup , folderLookup , depth + 1 , virtualIndex )
84+ var group = new DocumentationGroup ( file . Children , lookup , folderLookup , ref fileIndex , depth + 1 , virtualIndex )
8285 {
8386 Parent = this
8487 } ;
@@ -108,7 +111,7 @@ public DocumentationGroup(
108111 . ToArray ( ) ;
109112 }
110113
111- var group = new DocumentationGroup ( children , lookup , folderLookup , depth + 1 )
114+ var group = new DocumentationGroup ( children , lookup , folderLookup , ref fileIndex , depth + 1 )
112115 {
113116 Parent = this
114117 } ;
0 commit comments