commit
237e4bb84c
@ -0,0 +1,50 @@
|
||||
use crate::tokens::Greek;
|
||||
|
||||
pub trait ToMathML {
|
||||
fn to_mathml(&self) -> String;
|
||||
}
|
||||
|
||||
impl ToMathML for Greek {
|
||||
fn to_mathml(&self) -> String {
|
||||
let inner = match self {
|
||||
Greek::Alpha => "α",
|
||||
Greek::Beta => "β",
|
||||
Greek::Gamma => "γ",
|
||||
Greek::BigGamma => "Γ",
|
||||
Greek::Delta => "δ",
|
||||
Greek::BigDelta => "Δ",
|
||||
Greek::Epsilon => "ε",
|
||||
Greek::VarEpsilon => "ε",
|
||||
Greek::Zeta => "ζ",
|
||||
Greek::Eta => "η",
|
||||
Greek::Theta => "θ",
|
||||
Greek::BigTheta => "Θ",
|
||||
Greek::VarTheta => "θ",
|
||||
Greek::Iota => "ι",
|
||||
Greek::Kappa => "κ",
|
||||
Greek::Lambda => "λ",
|
||||
Greek::BigLambda => "Λ",
|
||||
Greek::Mu => "μ",
|
||||
Greek::Nu => "ν",
|
||||
Greek::Xi => "ξ",
|
||||
Greek::BigXi => "Ξ",
|
||||
Greek::Pi => "π",
|
||||
Greek::BigPi => "Π",
|
||||
Greek::Rho => "ρ",
|
||||
Greek::Sigma => "σ",
|
||||
Greek::BigSigma => "Σ",
|
||||
Greek::Tau => "τ",
|
||||
Greek::Upsilon => "υ",
|
||||
Greek::Phi => "φ",
|
||||
Greek::BigPhi => "Φ",
|
||||
Greek::VarPhi => "φ",
|
||||
Greek::Chi => "χ",
|
||||
Greek::Psi => "ψ",
|
||||
Greek::BigPsi => "Ψ",
|
||||
Greek::Omega => "ω",
|
||||
Greek::BigOmega => "Ω",
|
||||
};
|
||||
|
||||
format!("<mi>{}</mi>", inner)
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
pub mod mathml;
|
Loading…
Reference in New Issue