use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
pub struct Math {
    pub lang: MathLang,
    pub expression: String,
}

impl Math {
    pub fn math_ml(expression: String) -> Self {
        Self {
            lang: MathLang::MathML,
            expression,
        }
    }

    pub fn tex(expression: String) -> Self {
        Self {
            lang: MathLang::TeX,
            expression,
        }
    }
}

#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
pub enum MathLang {
    TeX,
    MathML,
}
