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

Inherits:
Object
  • Object
show all
Includes:
Element, 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

Instance Method Summary collapse

Methods included from Ext::Inline

lang, note, sub, sup

Constructor Details

#initialize(output) ⇒ InlinePlugin

Returns a new instance of InlinePlugin.



360
361
362
# File 'lib/rabbit/parser/wiki/output.rb', line 360

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

Instance Method Details

#brObject



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

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

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



364
365
366
367
368
# File 'lib/rabbit/parser/wiki/output.rb', line 364

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

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

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



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

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

#note(text, *rest) ⇒ Object



379
380
381
# File 'lib/rabbit/parser/wiki/output.rb', line 379

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

#sub(text, *rest) ⇒ Object



371
372
373
# File 'lib/rabbit/parser/wiki/output.rb', line 371

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

#sup(text, *rest) ⇒ Object



375
376
377
# File 'lib/rabbit/parser/wiki/output.rb', line 375

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

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



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

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

#waitObject



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

def wait
  WaitTag.new
end