An AsciiMath parser for .NET that converts string
AsciiMath expressions into MathML.
This is a .NET port of the ruby AsciiDoctor/AsciiMath implementation
Add the package to your application using
dotnet add package AsciiMath --prerelease
To use the parser, call the static Parser.ToMathMl(input)
method with the AsciiMath string
var asciiMath = "int_-1^1 sqrt(1-x^2)dx = pi/2";
var converted = Parser.ToMathMl(asciiMath);
Console.WriteLine(converted);
// prints <math><msub><mo>∫</mo><mo>−</mo></msub><msup><mn>1</mn><mn>1</mn></msup><msqrt><mrow><mn>1</mn><mo>−</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt><mi>dx</mi><mo>=</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></math>
This parser is currently in early development and may evolve both in the features it provides and the interface it uses.