Module: Kramdown::Converter::MathEngine::MathjaxNode

### Home Classes Methods

### In Files

- lib/kramdown/converter/math_engine/mathjaxnode.rb

### Methods

- ::call

### Class/Module Index

Quicksearch

- Kramdown
- Kramdown::Converter
- Kramdown::Converter::Base
- Kramdown::Converter::Html
- Kramdown::Converter::Kramdown
- Kramdown::Converter::Latex
- Kramdown::Converter::MathEngine
- Kramdown::Converter::MathEngine::Itex2MML
- Kramdown::Converter::MathEngine::Mathjax
- Kramdown::Converter::MathEngine::MathjaxNode
- Kramdown::Converter::MathEngine::Ritex
- Kramdown::Converter::RemoveHtmlTags
- Kramdown::Converter::SyntaxHighlighter
- Kramdown::Converter::SyntaxHighlighter::Coderay
- Kramdown::Converter::SyntaxHighlighter::Minted
- Kramdown::Converter::SyntaxHighlighter::Rouge
- Kramdown::Converter::Toc
- Kramdown::Document
- Kramdown::Element
- Kramdown::Error
- Kramdown::Options
- Kramdown::Options::Boolean
- Kramdown::Parser
- Kramdown::Parser::Base
- Kramdown::Parser::GFM
- Kramdown::Parser::Html
- Kramdown::Parser::Html::Constants
- Kramdown::Parser::Html::ElementConverter
- Kramdown::Parser::Html::Parser
- Kramdown::Parser::Kramdown
- Kramdown::Parser::Markdown
- Kramdown::Utils
- Kramdown::Utils::Configurable
- Kramdown::Utils::Entities
- Kramdown::Utils::Entities::Entity
- Kramdown::Utils::Html
- Kramdown::Utils::OrderedHash
- Kramdown::Utils::StringScanner
- Kramdown::Utils::Unidecoder

No matching classes.

# Kramdown::Converter::MathEngine::MathjaxNode

Uses the MathJax-node 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 28
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.