@@ -154,7 +154,7 @@ pub(crate) fn csv_report(
154154 dir_path : plot_path. to_owned ( ) ,
155155 } ) ?;
156156
157- for title in & titles {
157+ for ( n , title) in titles. iter ( ) . enumerate ( ) {
158158 let mut templates = Tera :: default ( ) ;
159159 templates. add_raw_template ( "plot.js.tera" , include_str ! ( "plot.js.tera" ) ) ?;
160160 let mut context = Context :: new ( ) ;
@@ -173,9 +173,10 @@ pub(crate) fn csv_report(
173173 _ => unreachable ! ( ) ,
174174 }
175175 context. insert ( "title" , & title) ;
176+ context. insert ( "index" , & n. to_string ( ) ) ;
176177 let js = templates. render ( "plot.js.tera" , & context) ?;
177178
178- let file_path = plot_path. to_owned ( ) + title + ".js" ;
179+ let file_path = plot_path. to_owned ( ) + "plot_" + & n . to_string ( ) + ".js" ;
179180 let mut file = fs:: File :: create ( file_path) ?;
180181 file. write_all ( js. as_bytes ( ) ) ?;
181182 }
@@ -255,7 +256,7 @@ pub(crate) fn csv_report(
255256 dir_path : prefix_path. to_owned ( ) ,
256257 } ) ?;
257258
258- for title in & titles {
259+ for ( n , title) in titles. iter ( ) . enumerate ( ) {
259260 if let Some ( prefix_table) = prefixes. get ( title. to_owned ( ) ) {
260261 let mut templates = Tera :: default ( ) ;
261262 templates. add_raw_template (
@@ -264,15 +265,16 @@ pub(crate) fn csv_report(
264265 ) ?;
265266 let mut context = Context :: new ( ) ;
266267 context. insert ( "title" , title) ;
268+ context. insert ( "index" , & n. to_string ( ) ) ;
267269 context. insert ( "table" , prefix_table) ;
268270 context. insert ( "numeric" , is_numeric. get ( title) . unwrap ( ) ) ;
269271 let html = templates. render ( "prefix_table.html.tera" , & context) ?;
270272
271- let file_path = output_path. to_owned ( ) + "/prefixes/" + title + ".html" ;
273+ let file_path = output_path. to_owned ( ) + "/prefixes/col_ " + & n . to_string ( ) + ".html" ;
272274 let mut file = fs:: File :: create ( file_path) ?;
273275 file. write_all ( html. as_bytes ( ) ) ?;
274276
275- let title_path = prefix_path. to_owned ( ) + "/" + title + "/" ;
277+ let title_path = prefix_path. to_owned ( ) + "/col_ " + & n . to_string ( ) + "/" ;
276278 fs:: create_dir ( Path :: new ( & title_path) ) . context ( WriteErr :: CantCreateDir {
277279 dir_path : title_path. to_owned ( ) ,
278280 } ) ?;
@@ -286,6 +288,7 @@ pub(crate) fn csv_report(
286288 let mut context = Context :: new ( ) ;
287289 context. insert ( "title" , title) ;
288290 context. insert ( "values" , values) ;
291+ context. insert ( "index" , & n. to_string ( ) ) ;
289292 let html = templates. render ( "lookup_table.html.tera" , & context) ?;
290293
291294 let file_path = title_path. to_owned ( ) + prefix + ".html" ;
0 commit comments