Skip to main content

figure_html

Function figure_html 

Source
pub fn figure_html(figure: &Figure<'_>, opts: &Emit) -> String
Expand description

One figure, as its own element.

use makeover_layout::{Figure, Tone};
use makeover_webview::{Emit, figure::figure_html};

let figure = Figure::new("17", "Current Streak").tone(Tone::Success);
let html = figure_html(&figure, &Emit::default());

assert!(html.contains(r#"data-tone="success""#));
assert!(html.contains(r#"aria-label="Current Streak: 17""#));