Module: Pandoku::Formats

Defined in:
lib/pandoku/formats/s5.rb,
lib/pandoku/formats/man.rb,
lib/pandoku/formats/odt.rb,
lib/pandoku/formats/rst.rb,
lib/pandoku/formats/rtf.rb,
lib/pandoku/formats/html.rb,
lib/pandoku/lookup_table.rb,
lib/pandoku/formats/latex.rb,
lib/pandoku/formats/context.rb,
lib/pandoku/formats/docbook.rb,
lib/pandoku/formats/texinfo.rb,
lib/pandoku/formats/markdown.rb,
lib/pandoku/formats/mediawiki.rb,
lib/pandoku/formats/opendocument.rb

Defined Under Namespace

Classes: ConTeXt, DocBook, HTML, LaTeX, LookupError, Man, Markdown, MediaWiki, ODT, OpenDocument, ReStructuredText, RichTextFormat, S5, Texinfo

Constant Summary collapse

Manual =

Aliases.

Man
ReST =

Aliases.

RST = ReStructuredText
RTF =

Aliases.

RichTextFormat
LOOKUP_TABLE =

Array of registered format classes.

[]
DocBookXML =
DocBookXml = Docbook = DocBook

Class Method Summary collapse

Class Method Details

.lookup(name, raises_exception = true) ⇒ Object

Find a format class by the name. It raises LookupError when it is not found, or returns nil if raises_exception is false.

Raises:



14
15
16
17
18
19
20
21
22
# File 'lib/pandoku/lookup_table.rb', line 14

def self.lookup(name, raises_exception = true)
  name = name.to_sym
  require "#{File.dirname(__FILE__)}/formats/#{name}"
  for format in LOOKUP_TABLE
    return format if format.name == name
  end
  return unless raises_exception
  raise LookupError, "there is no formatter named :#{name}"
end