An AsciiMath parser and MathML generator written in pure Ruby.
Installation
Add this line to your application’s Gemfile:
gem 'asciimath'
And then execute:
$ bundle
Or install it yourself as:
$ gem install asciimath
Usage
Library
First require the library.
require 'asciimath'
Then parse an AsciiMath string.
The parsed expression is a set of nested Array and Hash objects.
This expression can then be converted to MathML.
math_ml = parsed_expression.to_mathml
The MathML code is returned as a String.
Command line
The AsciiMath parser and MathML converter can be invoked via the command line as follows:
asciimath "an asciimath string"
This command will print out the generated MathML code on stdout.
Contributing
-
Create your feature branch (
git checkout -b my-new-feature
) -
Commit your changes (
git commit -am 'Add some feature'
) -
Push to the branch (
git push origin my-new-feature
) -
Create a new Pull Request