diff --git a/src/lib.rs b/src/lib.rs index 56ddfe6..9b7d084 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result> = None; - let mut directory: FxIndexMap, Vec> = FxIndexMap::default(); + let mut directory: FxIndexMap, Vec<(PathBuf, i32)>> = FxIndexMap::default(); // Store results in an output Vec let mut output: Vec<(PathBuf, String)> = Vec::new(); @@ -73,6 +73,8 @@ pub fn parse_path(path: &PathBuf, config: ParseConfig) -> anyhow::Result anyhow::Result { for (filename, out) in results { output.push((filename.clone(), out)); - compile_directory.push(filename); + compile_directory.push((filename, output_count)); + output_count += 1; } } Err(err) => match parser.name() { diff --git a/src/templates.rs b/src/templates.rs index 4deae4d..20f68b4 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -85,8 +85,8 @@ Build products below: {{ for compile_directory in directory }}
  • {compile_directory.0}
      - {{ for path in compile_directory.1 }} -
    • {path}
    • + {{ for path_idx in compile_directory.1 }} +
    • {path_idx.0} ({path_idx.1})
    • {{ endfor }}
  • diff --git a/src/types.rs b/src/types.rs index aa888ef..57209b2 100644 --- a/src/types.rs +++ b/src/types.rs @@ -304,7 +304,7 @@ pub struct DynamoGuardsContext { #[derive(Debug, Serialize)] pub struct IndexContext { pub css: &'static str, - pub directory: Vec<(String, Vec)>, + pub directory: Vec<(String, Vec<(PathBuf, i32)>)>, pub stack_trie_html: String, pub unknown_stack_trie_html: String, pub has_unknown_stack_trie: bool,