@@ -36,12 +36,13 @@ public DocumentationGroup(
36
36
IReadOnlyCollection < ITocItem > toc ,
37
37
IDictionary < string , DocumentationFile > lookup ,
38
38
IDictionary < string , DocumentationFile [ ] > folderLookup ,
39
+ ref int fileIndex ,
39
40
int depth = 0 ,
40
41
MarkdownFile ? index = null
41
42
)
42
43
{
43
44
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 ) ;
45
46
46
47
GroupsInOrder = groups ;
47
48
FilesInOrder = files ;
@@ -59,6 +60,7 @@ public DocumentationGroup(
59
60
IDictionary < string , DocumentationFile > lookup ,
60
61
IDictionary < string , DocumentationFile [ ] > folderLookup ,
61
62
int depth ,
63
+ ref int fileIndex ,
62
64
out List < DocumentationGroup > groups ,
63
65
out List < MarkdownFile > files ,
64
66
out List < INavigationItem > navigationItems )
@@ -75,10 +77,11 @@ public DocumentationGroup(
75
77
continue ;
76
78
77
79
md . Parent = this ;
80
+ md . NavigationIndex = ++ fileIndex ;
78
81
79
82
if ( file . Children . Count > 0 && d is MarkdownFile virtualIndex )
80
83
{
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 )
82
85
{
83
86
Parent = this
84
87
} ;
@@ -108,7 +111,7 @@ public DocumentationGroup(
108
111
. ToArray ( ) ;
109
112
}
110
113
111
- var group = new DocumentationGroup ( children , lookup , folderLookup , depth + 1 )
114
+ var group = new DocumentationGroup ( children , lookup , folderLookup , ref fileIndex , depth + 1 )
112
115
{
113
116
Parent = this
114
117
} ;
0 commit comments