Module: Rabbit::Parser

Includes:
GetText
Defined in:
lib/rabbit/parser.rb,
lib/rabbit/parser/rd.rb,
lib/rabbit/parser/rd.rb,
lib/rabbit/parser/pdf.rb,
lib/rabbit/parser/base.rb,
lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/wiki.rb,
lib/rabbit/parser/image.rb,
lib/rabbit/parser/ext/tex.rb,
lib/rabbit/parser/markdown.rb,
lib/rabbit/parser/markdown.rb,
lib/rabbit/parser/ext/emacs.rb,
lib/rabbit/parser/ext/image.rb,
lib/rabbit/parser/ext/video.rb,
lib/rabbit/parser/ext/entity.rb,
lib/rabbit/parser/ext/escape.rb,
lib/rabbit/parser/ext/inline.rb,
lib/rabbit/parser/rd/visitor.rb,
lib/rabbit/parser/ext/coderay.rb,
lib/rabbit/parser/rd/ext/base.rb,
lib/rabbit/parser/wiki/output.rb,
lib/rabbit/parser/ext/aafigure.rb,
lib/rabbit/parser/ext/enscript.rb,
lib/rabbit/parser/rd/ext/image.rb,
lib/rabbit/parser/rd/ext/refer.rb,
lib/rabbit/parser/rd/ext/video.rb,
lib/rabbit/parser/ext/blockdiag.rb,
lib/rabbit/parser/pause-support.rb,
lib/rabbit/parser/rd/rd2rabbit-lib.rb,
lib/rabbit/parser/markdown/converter.rb,
lib/rabbit/parser/rd/ext/block-verbatim.rb,
lib/rabbit/parser/rd/ext/inline-verbatim.rb,
lib/rabbit/parser/rd/ext/character-reference.rb

Defined Under Namespace

Modules: Ext, PauseSupport Classes: Base, Image, Markdown, NoteSetter, PDF, RD, SlidePropertySetter, Wiki

Constant Summary

Constants included from GetText

GetText::DOMAIN

Class Method Summary collapse

Methods included from GetText

included

Class Method Details

.normalize_property_name(name) ⇒ Object



24
25
26
# File 'lib/rabbit/parser.rb', line 24

def normalize_property_name(name)
  name.gsub(/_/, "-").strip
end

.parse(canvas, source) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rabbit/parser.rb', line 11

def parse(canvas, source)
  parser = Base.find_loader(source)
  if parser.nil?
    format = _("unsupported format. (supported: %s)")
    format_names = Base.loaders.collect do |loader|
      loader.format_name
    end
    message = format % "[#{format_names.join(', ')}]"
    raise UnsupportedFormatError.new(message)
  end
  parser.new(canvas, source).parse
end