Sha256: b18bc90cdc76c5fdcabd14062989f049d5b8080034d5762bddc2a2bf41146738

Contents?: true

Size: 525 Bytes

Versions: 8

Compression:

Stored size: 525 Bytes

Contents

require_relative 'parser'
require_relative 'mathml'
require_relative 'html'
require_relative 'latex'

module AsciiMath
  module CLI
    def self.run(args)
      asciimath = args.last
      output = ''
      if args.length == 1 || args.first == "mathml"
        output = AsciiMath.parse(asciimath).to_mathml
      elsif args.first == "html"
        output = AsciiMath.parse(asciimath).to_html
      elsif args.first == "latex"
        output = AsciiMath.parse(asciimath).to_latex
      end
      puts output
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
asciimath-2.0.5 lib/asciimath/cli.rb
asciimath-2.0.4 lib/asciimath/cli.rb
asciimath-2.0.3 lib/asciimath/cli.rb
asciimath-2.0.2 lib/asciimath/cli.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/asciimath-2.0.1/lib/asciimath/cli.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/asciimath-2.0.1/lib/asciimath/cli.rb
asciimath-2.0.1 lib/asciimath/cli.rb
asciimath-2.0.0 lib/asciimath/cli.rb