module Kramdown::Converter::MathEngine::MathjaxNode
Uses the mathjax-node-cli library for converting math formulas to MathML.
Constants
- AVAILABLE
MathjaxNode is available if this constant is
true
.
Public Class Methods
call(converter, el, opts)
click to toggle source
# File lib/kramdown/converter/math_engine/mathjaxnode.rb, line 36 def self.call(converter, el, opts) type = el.options[:category] cmd = [T2MPATH] cmd << "--inline" unless type == :block cmd << "--semantics" if converter.options[:math_engine_opts][:semantics] == true cmd << "--notexhints" if converter.options[:math_engine_opts][:texhints] == false result = IO.popen(cmd << el.value).read.strip attr = el.attr.dup attr.delete('xmlns') attr.delete('display') result.insert("<math".length, converter.html_attributes(attr)) (type == :block ? "#{' '*opts[:indent]}#{result}\n" : result) end