Skip to main content

math_core_renderer_internal/
lib.rs

1//! Internal library for the `math-core` crate for rendering MathML.
2//!
3//! This library allows you to construct an AST representing MathML and then render it to a string.
4//!
5//! # Example
6//!
7//! ```rust
8//! use math_core_renderer_internal::ast::Node;
9//! use math_core_renderer_internal::symbol;
10//! use math_core_renderer_internal::attribute::{MathSpacing, LetterAttr, OpAttrs};
11//!
12//! let ast = Node::Row {
13//!     nodes: &[
14//!         &Node::Under {
15//!             target: &Node::Operator {
16//!                 op: symbol::N_ARY_SUMMATION.as_op(),
17//!                 attrs: OpAttrs::empty(),
18//!                 left: Some(MathSpacing::Zero),
19//!                 right: None,
20//!                 size: None,
21//!             },
22//!             symbol: &Node::IdentifierChar('i'.into(), LetterAttr::Default),
23//!         },
24//!         &Node::IdentifierChar('i'.into(), LetterAttr::Default),
25//!      ],
26//!      attr: None,
27//! };
28//!
29//! let mut output = String::new();
30//! ast.emit(&mut output, 0).unwrap();
31//! assert_eq!(
32//!     output,
33//!     "<mrow><munder><mo lspace=\"0\">∑</mo><mi>i</mi></munder><mi>i</mi></mrow>"
34//! );
35//! ```
36pub mod arena;
37pub mod ast;
38pub mod attribute;
39pub mod fmt;
40mod itoa;
41pub mod length;
42pub mod super_char;
43pub mod symbol;
44pub mod table;