Crate asciimath_unicode

Crate asciimath_unicode 

Source
Expand description

A module for converting asciimath to unicode

To convert asciimath quickly, you can use the write_unicode or convert_unicode methods. If you want more control, see the options exposed through InlineRenderer which can be rendered into RenderedUnicode.

§Usage

§Binary

This crate provides a simple cli for converting asciimath to unicode:

cargo install asciimath-unicode --features binary
asciimath-unicode -h

§Library

cargo add asciimath-parser
let res = asciimath_unicode::convert_unicode("1/2");
assert_eq!(res, "½");
use asciimath_unicode::InlineRenderer;
let renderer = InlineRenderer {
    vulgar_fracs: false,
    ..Default::default()
};
let res: String = renderer.render("1/2").collect();
assert_eq!(res, "¹⁄₂");

Structs§

InlineRenderer
An inline unicode renderer for asciimath
RenderedUnicode
Rendered unicode

Enums§

SkinTone
The skin tone of an emoji.

Functions§

convert_unicode
Convert an asciimath string into a unicode string
parse_unicode
Parse asciimath using the conventions of this renderer
write_unicode
Convert an asciimath string into unicode and write it to the writer