Skip to content

Commit 1eb4861

Browse files
Add new HtmlFragments type
1 parent 28bad2b commit 1eb4861

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

crates/anstyle-svg/src/lib.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,24 @@ impl Term {
316316
}
317317
}
318318

319+
/// Contains the different parts of a HTML rendered page.
320+
pub struct HtmlFragments {
321+
style: String,
322+
body: String,
323+
}
324+
325+
impl HtmlFragments {
326+
/// Content that can be used directly in a `<style>` tag.
327+
pub fn style(&self) -> &str {
328+
&self.style
329+
}
330+
331+
/// Content that can be put in the HTML body or any tag inside the `<body>`.
332+
pub fn body(&self) -> &str {
333+
&self.body
334+
}
335+
}
336+
319337
const FG_COLOR: anstyle::Color = anstyle::Color::Ansi(anstyle::AnsiColor::White);
320338
const BG_COLOR: anstyle::Color = anstyle::Color::Ansi(anstyle::AnsiColor::Black);
321339

0 commit comments

Comments
 (0)