diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-10-30 18:55:47 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-10-30 19:12:15 +0200 |
commit | ad26e9d84925532ae5522aad8def5d764fe0ffbe (patch) | |
tree | 0fd717f54feddf2975ff134d2f32c343dc2cc28b /src/doc.rs | |
parent | 5a84e1bde773bdc782c1db5a633ef8765f220253 (diff) | |
download | subplot-ad26e9d84925532ae5522aad8def5d764fe0ffbe.tar.gz |
feat: allow adding CSS URLs to HTML output
This is in the meta data field "css_urls".
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
Diffstat (limited to 'src/doc.rs')
-rw-r--r-- | src/doc.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -160,6 +160,14 @@ impl Document { } head.push_child(Content::Elt(css)); + for css_url in self.meta.css_urls() { + let mut link = Element::new(ElementTag::Link); + link.push_attribute(Attribute::new("rel", "stylesheet")); + link.push_attribute(Attribute::new("type", "text/css")); + link.push_attribute(Attribute::new("href", css_url)); + head.push_child(Content::Elt(link)); + } + self.meta.set_date(date.into()); let mut body_content = Element::new(crate::html::ElementTag::Div); |