use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Equation {
pub math: String,
pub display: bool,
pub label: Option<String>,
}
impl Equation {
pub fn display(math: impl Into<String>) -> Self {
Self {
math: math.into(),
display: true,
label: None,
}
}
pub fn inline(math: impl Into<String>) -> Self {
Self {
math: math.into(),
display: false,
label: None,
}
}
pub fn with_label(mut self, label: impl Into<String>) -> Self {
self.label = Some(label.into());
self
}
}