pub enum MathRender {
None,
CommonmarkKatex,
Dollar,
}Expand description
Delimiter rewrite policy for math regions at emit time.
mdwright never typesets math itself; downstream renderers
(KaTeX, MathJax, mkdocs-material’s math plugin) do that. The
modes here determine the shape of the math regions in the
formatted output so the downstream renderer recognises them.
Self::None(default): pass math regions through verbatim; today’s behaviour.Self::CommonmarkKatex: same emission asNone, but signals intent in build logs. The bracket/paren forms (\[…\],\(…\)) and dollar forms ($$…$$,$…$) are both recognised byKaTeXandMathJaxv3 auto-renderers without rewriting.Self::Dollar: rewrite\[ … \]to$$ … $$and\( … \)to$ … $at emit time. LaTeX environments (\begin{align*}…\end{align*}) are not rewritten; there is no dollar form of an environment.
Variants§
None
Pass math regions through verbatim.
CommonmarkKatex
Pass through verbatim; greppable signal that downstream is
KaTeX or MathJax over CommonMark-shaped math.
Dollar
Rewrite backslash-bracket / backslash-paren math to dollar form. Environments are left unchanged.
Trait Implementations§
Source§impl Clone for MathRender
impl Clone for MathRender
Source§fn clone(&self) -> MathRender
fn clone(&self) -> MathRender
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MathRender
impl Debug for MathRender
Source§impl Default for MathRender
impl Default for MathRender
Source§fn default() -> MathRender
fn default() -> MathRender
Returns the “default value” for a type. Read more
Source§impl PartialEq for MathRender
impl PartialEq for MathRender
Source§fn eq(&self, other: &MathRender) -> bool
fn eq(&self, other: &MathRender) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for MathRender
impl Eq for MathRender
impl StructuralPartialEq for MathRender
Auto Trait Implementations§
impl Freeze for MathRender
impl RefUnwindSafe for MathRender
impl Send for MathRender
impl Sync for MathRender
impl Unpin for MathRender
impl UnsafeUnpin for MathRender
impl UnwindSafe for MathRender
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more