Skip to main content

Crate asciimath_unicode

Crate asciimath_unicode 

Source
Expand description

A module for converting asciimath to unicode

To convert asciimath quickly, you can use parse_unicode to get an Asciimath value that implements fmt::Display. If you want more control, see the options exposed through Conf which can parse input into Asciimath as well.

§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-unicode
let res = asciimath_unicode::parse_unicode("1/2").to_string();
assert_eq!(res, "½");
use asciimath_unicode::Conf;
let conf = Conf {
    vulgar_fracs: false,
    ..Default::default()
};
let res = conf.parse("1/2").to_string();
assert_eq!(res, "¹⁄₂");

Structs§

Asciimath
Parsed asciimath expression ready for rendering
Conf
Configuration for unicode rendering of asciimath

Enums§

SkinTone
The skin tone of an emoji.

Functions§

parse_unicode
Parse asciimath into an Asciimath value that implements fmt::Display