Class: Jekyll::JekyllTexEqn::RenderTexTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-tex-eqn.rb

Overview

Liquid tag for inline equations

Constant Summary collapse

TAGNAME =
"ieqn"

Instance Method Summary collapse

Constructor Details

#initialize(tagname, text, tokens) ⇒ RenderTexTag

Returns a new instance of RenderTexTag.



227
228
229
230
231
# File 'lib/jekyll-tex-eqn.rb', line 227

def initialize(tagname, text, tokens)
  super
  @content = text
  @content.chomp
end

Instance Method Details

#render(context) ⇒ Object



233
234
235
236
# File 'lib/jekyll-tex-eqn.rb', line 233

def render(context)
  svg = Generate.do_render(context, @content, Util.get_option(Util::INLINE_SCALE_KEY, Util::DEFAULT_INLINE_SCALE).to_f, "$", "$")
  "<span class='#{Util.get_option(Util::INLINE_CLASS_KEY, "")}'><img width='#{svg[:width]}px' height='#{svg[:height]}px' src='/#{svg[:file]}'/></span>"
end