@@ -3,6 +3,7 @@ use super::sidepanels::SidepanelCtx;
3
3
use super :: symbols:: SymbolContentCtx ;
4
4
use super :: util:: qualify_drilldown_name;
5
5
use super :: util:: BreadcrumbsCtx ;
6
+ use super :: util:: SectionHeaderCtx ;
6
7
use super :: DocNodeKindWithDrilldown ;
7
8
use super :: DocNodeWithContext ;
8
9
use super :: FileMode ;
@@ -93,10 +94,9 @@ impl IndexCtx {
93
94
partitions : Partition ,
94
95
file : Option < ShortPath > ,
95
96
) -> Self {
96
- let short_path =
97
- specifier
98
- . cloned ( )
99
- . map ( |specifier| ShortPath :: new ( ctx, specifier) ) ;
97
+ let short_path = specifier
98
+ . cloned ( )
99
+ . map ( |specifier| ShortPath :: new ( ctx, specifier) ) ;
100
100
101
101
// will be default on index page with no main entrypoint
102
102
let default = vec ! [ ] ;
@@ -105,13 +105,13 @@ impl IndexCtx {
105
105
. and_then ( |specifier| doc_nodes_by_url. get ( specifier) )
106
106
. unwrap_or ( & default) ;
107
107
108
- let render_ctx = RenderContext :: new (
109
- ctx,
110
- doc_nodes,
111
- short_path
112
- . as_ref ( )
113
- . map_or ( UrlResolveKind :: Root , UrlResolveKind :: File ) ,
114
- ) ;
108
+ let render_ctx = RenderContext :: new (
109
+ ctx,
110
+ doc_nodes,
111
+ short_path
112
+ . as_ref ( )
113
+ . map_or ( UrlResolveKind :: Root , UrlResolveKind :: File ) ,
114
+ ) ;
115
115
116
116
let module_doc = short_path. as_ref ( ) . map ( |short_path| {
117
117
super :: jsdoc:: ModuleDocCtx :: new ( & render_ctx, short_path, doc_nodes_by_url)
@@ -128,8 +128,23 @@ impl IndexCtx {
128
128
HtmlHeadCtx :: new ( & root, "Index" , ctx. package_name . as_ref ( ) , None ) ;
129
129
130
130
let all_symbols = if ctx. file_mode == FileMode :: SingleDts {
131
- let sections =
132
- super :: namespace:: render_namespace ( & render_ctx, partitions. clone ( ) ) ;
131
+ let sections = super :: namespace:: render_namespace (
132
+ & render_ctx,
133
+ partitions
134
+ . clone ( )
135
+ . into_iter ( )
136
+ . map ( |( title, nodes) | {
137
+ (
138
+ SectionHeaderCtx {
139
+ title,
140
+ href : None ,
141
+ doc : None ,
142
+ } ,
143
+ nodes,
144
+ )
145
+ } )
146
+ . collect ( ) ,
147
+ ) ;
133
148
134
149
Some ( SymbolContentCtx {
135
150
id : String :: new ( ) ,
@@ -183,36 +198,36 @@ impl AllSymbolsCtx {
183
198
. map ( |( path, nodes) | {
184
199
let module_doc_nodes = doc_nodes_by_url. get ( & path. specifier ) . unwrap ( ) ;
185
200
186
- let doc = module_doc_nodes
187
- . iter ( )
188
- . find ( |n| n. kind == DocNodeKind :: ModuleDoc )
189
- . and_then ( |node| node. js_doc . doc . as_ref ( ) )
190
- . and_then ( |doc| {
191
- markdown_to_html (
192
- & render_ctx,
193
- doc,
194
- MarkdownToHTMLOptions {
195
- summary : true ,
196
- summary_prefer_title : true ,
197
- render_toc : false ,
198
- } ,
199
- )
200
- } )
201
- . map ( |markdown| markdown. html ) ;
202
-
203
- let header = crate :: html:: util:: SectionHeaderCtx {
204
- title : path. display_name ( ) ,
205
- href : Some ( render_ctx. ctx . href_resolver . resolve_path (
206
- render_ctx. get_current_resolve ( ) ,
207
- path. as_resolve_kind ( ) ,
208
- ) ) ,
209
- doc,
210
- } ;
211
-
212
- ( header, nodes)
213
- } )
214
- . collect ( ) ,
215
- ) ;
201
+ let doc = module_doc_nodes
202
+ . iter ( )
203
+ . find ( |n| n. kind == DocNodeKind :: ModuleDoc )
204
+ . and_then ( |node| node. js_doc . doc . as_ref ( ) )
205
+ . and_then ( |doc| {
206
+ markdown_to_html (
207
+ & render_ctx,
208
+ doc,
209
+ MarkdownToHTMLOptions {
210
+ summary : true ,
211
+ summary_prefer_title : true ,
212
+ render_toc : false ,
213
+ } ,
214
+ )
215
+ } )
216
+ . map ( |markdown| markdown. html ) ;
217
+
218
+ let header = crate :: html:: util:: SectionHeaderCtx {
219
+ title : path. display_name ( ) ,
220
+ href : Some ( render_ctx. ctx . href_resolver . resolve_path (
221
+ render_ctx. get_current_resolve ( ) ,
222
+ path. as_resolve_kind ( ) ,
223
+ ) ) ,
224
+ doc,
225
+ } ;
226
+
227
+ ( header, nodes)
228
+ } )
229
+ . collect ( ) ,
230
+ ) ;
216
231
217
232
let html_head_ctx =
218
233
HtmlHeadCtx :: new ( "./" , "All Symbols" , ctx. package_name . as_ref ( ) , None ) ;
0 commit comments