diff options
Diffstat (limited to 'src/metadata.rs')
-rw-r--r-- | src/metadata.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/metadata.rs b/src/metadata.rs index dc28ac4..e382840 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -51,6 +51,7 @@ pub struct YamlMetadata { #[serde(default)] impls: BTreeMap<String, Vec<PathBuf>>, css_embed: Option<Vec<PathBuf>>, + css_urls: Option<Vec<String>>, } impl YamlMetadata { @@ -169,6 +170,7 @@ pub struct Metadata { /// Extra class names which should be considered 'correct' for this document classes: Vec<String>, css_embed: Vec<String>, + css_urls: Vec<String>, } #[derive(Debug)] @@ -221,6 +223,12 @@ impl Metadata { } } + let css_urls = if let Some(urls) = &yaml.css_urls { + urls.clone() + } else { + vec![] + }; + let meta = Self { basedir: basedir.as_ref().to_path_buf(), title: yaml.title().into(), @@ -232,6 +240,7 @@ impl Metadata { impls, classes, css_embed, + css_urls, }; trace!("metadata: {:#?}", meta); @@ -297,6 +306,11 @@ impl Metadata { pub fn css_embed(&self) -> impl Iterator<Item = &str> { self.css_embed.iter().map(Deref::deref) } + + /// List of CSS urls to add to the HTML output. + pub fn css_urls(&self) -> impl Iterator<Item = &str> { + self.css_urls.iter().map(Deref::deref) + } } impl DocumentImpl { |