diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-06-08 06:08:32 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-06-08 06:21:52 +0300 |
commit | 4eaf5080ce8f2bbece3110b196c6e4fa83f4e0d7 (patch) | |
tree | 26a3f44c7aacc94370c30427e00696275a2240a9 /src/bin/sp-meta.rs | |
parent | bba22e1f86967feebf94ebac327f7489c1029afd (diff) | |
download | subplot-4eaf5080ce8f2bbece3110b196c6e4fa83f4e0d7.tar.gz |
feat(sp-meta): list names of embedded files in output
Diffstat (limited to 'src/bin/sp-meta.rs')
-rw-r--r-- | src/bin/sp-meta.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bin/sp-meta.rs b/src/bin/sp-meta.rs index 49f6173..b693d26 100644 --- a/src/bin/sp-meta.rs +++ b/src/bin/sp-meta.rs @@ -45,6 +45,7 @@ struct Metadata { function_files: Vec<String>, bibliographies: Vec<String>, scenarios: Vec<String>, + files: Vec<String>, } impl TryFrom<&mut Document> for Metadata { @@ -79,6 +80,11 @@ impl TryFrom<&mut Document> for Metadata { .into_iter() .map(|s| s.title().to_owned()) .collect(); + let files = doc + .files() + .iter() + .map(|f| f.filename().to_owned()) + .collect(); Ok(Self { sources, title, @@ -86,6 +92,7 @@ impl TryFrom<&mut Document> for Metadata { function_files, bibliographies, scenarios, + files, }) } } @@ -101,6 +108,7 @@ impl Metadata { Self::write_list(&self.binding_files, "bindings"); Self::write_list(&self.function_files, "functions"); Self::write_list(&self.bibliographies, "bibliography"); + Self::write_list(&self.files, "file"); Self::write_list(&self.scenarios, "scenario"); } } |