class Rabbit::Parser::Wiki::RabbitOutput::BlockPlugin

Public Class Methods

new(output) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 456
def initialize(output)
  @output = output
end

Public Instance Methods

LaTeX(source, props={}) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 490
def LaTeX(source, props={})
  args = [@output.canvas, source]
  Ext::Image.make_image_from_file(*args) do |src_file|
    props = Utils.stringify_hash_key(props)
    args = [src_file.path, props, @output.canvas]
    [Ext::TeX.make_image_by_LaTeX(*args), props]
  end
end
Also aliased as: latex
aafigure(source, props={}) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 510
def aafigure(source, props={})
  args = [@output.canvas, source]
  Ext::Image.make_image_from_file(*args) do |src_file|
    props = Utils.stringify_hash_key(props)
    args = [src_file.path, props, @output.canvas]
    [Ext::AAFigure.make_image(*args), props]
  end
end
blockdiag(source, props={}) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 519
def blockdiag(source, props={})
  args = [@output.canvas, source]
  Ext::Image.make_image_from_file(*args) do |src_file|
    props = Utils.stringify_hash_key(props)
    args = [src_file.path, props, @output.canvas]
    [Ext::BlockDiag.make_image(*args), props]
  end
end
coderay(lang, source) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 528
def coderay(lang, source)
  logger = @output.canvas.logger
  Ext::CodeRay.highlight(lang, source, logger)
end
emacs(source, mode_line=nil) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 533
def emacs(source, mode_line=nil)
  logger = @output.canvas.logger
  Ext::Emacs.highlight(source, logger, mode_line)
end
enscript(lang, source) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 481
def enscript(lang, source)
  logger = @output.canvas.logger
  if Ext::Enscript.check_availability(lang, logger)
    Ext::Enscript.highlight(lang, source, logger)
  else
    nil
  end
end
image(source, props={}) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 460
def image(source, props={})
  if props[:align].to_s == "right"
    body = @output.current_body
    if body["background-image"]
      raise ParseError,
            _("multiple {{image(..., :align => :right)}} " + \
              "isn't supported.")
    end
    body["background-image"] = source
    props.each do |name, value|
      name = name.to_s.gsub(/_/, "-")
      value = value.to_s if name == "align"
      body["background-image-#{name}"] = value
    end
    :no_element
  else
    Ext::Image.make_image(@output.canvas, source, props)
  end
end
Also aliased as: img
img(source, props={})
Alias for: image
latex(source, props={})
Alias for: LaTeX
mimeTeX(source, props={}) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 500
def mimeTeX(source, props={})
  args = [@output.canvas, source]
  Ext::Image.make_image_from_file(*args) do |src_file|
    props = Utils.stringify_hash_key(props)
    args = [src_file.path, props, @output.canvas]
    [Ext::TeX.make_image_by_mimeTeX(*args), props]
  end
end
Also aliased as: mimetex
mimetex(source, props={})
Alias for: mimeTeX
rouge(lang, source) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 538
def rouge(lang, source)
  logger = @output.canvas.logger
  Ext::Rouge.highlight(lang, source, logger)
end
tag(name, value=nil) click to toggle source
# File lib/rabbit/parser/wiki/output.rb, line 543
def tag(name, value=nil)
  if value
    CustomTag.new(name, @output.text(value))
  else
    CustomTag.new(name)
  end
end