Class: Rabbit::Parser::Wiki::RabbitOutput::InlinePlugin

Inherits:
Object
  • Object
show all
Includes:
Element, GetText, Ext::Entity, Ext::Inline
Defined in:
lib/rabbit/parser/wiki/output.rb

Defined Under Namespace

Classes: Private

Constant Summary

Constants included from Ext::Entity

Ext::Entity::TABLE

Constants included from GetText

GetText::DOMAIN

Instance Method Summary collapse

Methods included from Ext::Inline

lang, note, sub, sup

Methods included from GetText

included

Constructor Details

#initialize(output) ⇒ InlinePlugin

Returns a new instance of InlinePlugin.



382
383
384
# File 'lib/rabbit/parser/wiki/output.rb', line 382

def initialize(output)
  @private = Private.new(output)
end

Instance Method Details

#brObject



418
419
420
# File 'lib/rabbit/parser/wiki/output.rb', line 418

def br
  Text.new("\n")
end

#code_point(code_point, *rest) ⇒ Object



398
399
400
# File 'lib/rabbit/parser/wiki/output.rb', line 398

def code_point(code_point, *rest)
  @private.pack(Text.new([code_point].pack("U")), *rest)
end

#entity(entity, *rest) ⇒ Object Also known as: e



391
392
393
394
395
# File 'lib/rabbit/parser/wiki/output.rb', line 391

def entity(entity, *rest)
  return nil unless TABLE.include?(entity)

  @private.pack(Text.new(TABLE[entity]), *rest)
end

#image(source, props = {}) ⇒ Object

Raises:



386
387
388
389
# File 'lib/rabbit/parser/wiki/output.rb', line 386

def image(source, props={})
  raise ParseError,
        _("inline {{image(...)}} isn't supported.")
end

#lang(lang, text, *rest) ⇒ Object



414
415
416
# File 'lib/rabbit/parser/wiki/output.rb', line 414

def lang(lang, text, *rest)
  super(lang, @private.pack(text, *rest))
end

#note(text, *rest) ⇒ Object



410
411
412
# File 'lib/rabbit/parser/wiki/output.rb', line 410

def note(text, *rest)
  super(@private.pack(text, *rest))
end

#sub(text, *rest) ⇒ Object



402
403
404
# File 'lib/rabbit/parser/wiki/output.rb', line 402

def sub(text, *rest)
  super(@private.pack(text, *rest))
end

#sup(text, *rest) ⇒ Object



406
407
408
# File 'lib/rabbit/parser/wiki/output.rb', line 406

def sup(text, *rest)
  super(@private.pack(text, *rest))
end

#tag(name, text = nil, *rest) ⇒ Object



426
427
428
429
430
431
432
# File 'lib/rabbit/parser/wiki/output.rb', line 426

def tag(name, text=nil, *rest)
  if text
    CustomTag.new(name, @private.pack(text, *rest))
  else
    CustomTag.new(name)
  end
end

#waitObject



422
423
424
# File 'lib/rabbit/parser/wiki/output.rb', line 422

def wait
  WaitTag.new
end