### Home Classes Methods

### In Files

- lib/rabbit/parser/rd/rd2rabbit-lib.rb

### Parent

Visitor

### Methods

- ::new
- #apply_to_Code
- #apply_to_DescList
- #apply_to_DescListItem
- #apply_to_DocumentElement
- #apply_to_Emphasis
- #apply_to_EnumList
- #apply_to_EnumListItem
- #apply_to_Footnote
- #apply_to_Foottext
- #apply_to_Headline
- #apply_to_Include
- #apply_to_Index
- #apply_to_ItemList
- #apply_to_ItemListItem
- #apply_to_Keyboard
- #apply_to_List
- #apply_to_ListItem
- #apply_to_MethodList
- #apply_to_MethodListItem
- #apply_to_Reference_with_RDLabel
- #apply_to_Reference_with_URL
- #apply_to_String
- #apply_to_StringElement
- #apply_to_TextBlock
- #apply_to_Var
- #apply_to_Verb
- #apply_to_Verbatim
- #create_have_text_element
- #current_body
- #visit

### Included Modules

- ::RD::MethodParse
- Rabbit::Element
- Rabbit::Parser::PauseSupport

### Class/Module Index

Quicksearch

- Rabbit
- Rabbit::AAFigureCanNotHandleError
- Rabbit::Action
- Rabbit::ApplyFinish
- Rabbit::AuthorConfiguration
- Rabbit::BlockDiagCanNotHandleError
- Rabbit::CantAllocateColorError
- Rabbit::CantFindHTMLTemplate
- Rabbit::CantFindThemeRDTemplate
- Rabbit::Canvas
- Rabbit::Command
- Rabbit::Command::Rabbit
- Rabbit::Command::RabbitSlide
- Rabbit::Command::RabbitTheme
- Rabbit::Config
- Rabbit::Console
- Rabbit::Converter
- Rabbit::CursorManager
- Rabbit::DependencyCanvas
- Rabbit::DiaCanNotHandleError
- Rabbit::DirtyCount
- Rabbit::EPSCanNotHandleError
- Rabbit::Element
- Rabbit::Element::Author
- Rabbit::Element::Base
- Rabbit::Element::Base::DrawHook
- Rabbit::Element::BlockElement
- Rabbit::Element::BlockHorizontalCentering
- Rabbit::Element::BlockQuote
- Rabbit::Element::Body
- Rabbit::Element::ClassName
- Rabbit::Element::Code
- Rabbit::Element::Comment
- Rabbit::Element::Container
- Rabbit::Element::ContainerElement
- Rabbit::Element::ContentSource
- Rabbit::Element::CustomTag
- Rabbit::Element::Date
- Rabbit::Element::DeletedText
- Rabbit::Element::DescriptionContent
- Rabbit::Element::DescriptionList
- Rabbit::Element::DescriptionListItem
- Rabbit::Element::DescriptionTerm
- Rabbit::Element::Emphasis
- Rabbit::Element::EnumList
- Rabbit::Element::EnumListItem
- Rabbit::Element::FootText
- Rabbit::Element::FootTextBlock
- Rabbit::Element::Footnote
- Rabbit::Element::HeadLine
- Rabbit::Element::Image
- Rabbit::Element::ImageTitleSlide
- Rabbit::Element::Index
- Rabbit::Element::IndexSlide
- Rabbit::Element::IndexThumbnail
- Rabbit::Element::IndexThumbnailRow
- Rabbit::Element::Institution
- Rabbit::Element::ItemList
- Rabbit::Element::ItemListItem
- Rabbit::Element::Keyboard
- Rabbit::Element::Keyword
- Rabbit::Element::MethodDescription
- Rabbit::Element::MethodKind
- Rabbit::Element::MethodList
- Rabbit::Element::MethodListItem
- Rabbit::Element::MethodName
- Rabbit::Element::MethodTerm
- Rabbit::Element::Note
- Rabbit::Element::Paragraph
- Rabbit::Element::Place
- Rabbit::Element::PopplerPage
- Rabbit::Element::PopplerSlide
- Rabbit::Element::PopplerTitleSlide
- Rabbit::Element::PreformattedBlock
- Rabbit::Element::PreformattedText
- Rabbit::Element::ReferText
- Rabbit::Element::Slide
- Rabbit::Element::SlideElement
- Rabbit::Element::Subscript
- Rabbit::Element::Subtitle
- Rabbit::Element::Superscript
- Rabbit::Element::SyntaxHighlightingBlock
- Rabbit::Element::SyntaxHighlightingText
- Rabbit::Element::Table
- Rabbit::Element::TableBody
- Rabbit::Element::TableCell
- Rabbit::Element::TableHead
- Rabbit::Element::TableHeader
- Rabbit::Element::TableRow
- Rabbit::Element::Text
- Rabbit::Element::TextBlock
- Rabbit::Element::TextBlockElement
- Rabbit::Element::TextContainer
- Rabbit::Element::TextContainerElement
- Rabbit::Element::TextElement
- Rabbit::Element::TextRenderer
- Rabbit::Element::Title
- Rabbit::Element::TitleSlide
- Rabbit::Element::Variable
- Rabbit::Element::Verbatim
- Rabbit::Element::Video
- Rabbit::Element::WaitBlock
- Rabbit::Element::WaitTag
- Rabbit::Element::When
- Rabbit::Element::Where
- Rabbit::EmbedFrame
- Rabbit::Error
- Rabbit::Format
- Rabbit::Format::ConvenienceTextFormatter
- Rabbit::Format::Foreground
- Rabbit::Format::Formatter
- Rabbit::Format::Size
- Rabbit::Format::SpanTextFormatter
- Rabbit::Format::ValueContainerFormatter
- Rabbit::Frame
- Rabbit::Front
- Rabbit::Front::PublicLevel
- Rabbit::GIMPCanNotHandleError
- Rabbit::GemBuilder
- Rabbit::GemFinder
- Rabbit::Gesture
- Rabbit::Gesture::Handler
- Rabbit::Gesture::Processor
- Rabbit::GetText
- Rabbit::Graffiti
- Rabbit::Graffiti::ConfigDialog
- Rabbit::Graffiti::Processor
- Rabbit::HTML
- Rabbit::HTML::Generator
- Rabbit::ImageFileDoesNotExistError
- Rabbit::ImageLoadError
- Rabbit::ImageLoadWithExternalCommandError
- Rabbit::ImageLoader
- Rabbit::ImageManipulable
- Rabbit::ImageManipulable::Base
- Rabbit::ImageManipulable::Default
- Rabbit::ImageManipulable::Dia
- Rabbit::ImageManipulable::EPS
- Rabbit::ImageManipulable::GIMP
- Rabbit::ImageManipulable::PDF
- Rabbit::ImageManipulable::SVG
- Rabbit::ImmutableSourceTypeError
- Rabbit::InfoWindow
- Rabbit::InvalidImageSizeError
- Rabbit::InvalidMotionError
- Rabbit::Keys
- Rabbit::Keys::Alt
- Rabbit::Keys::Control
- Rabbit::Keys::Shift
- Rabbit::Logger
- Rabbit::Logger::Base
- Rabbit::Logger::GUI
- Rabbit::Logger::STDERR
- Rabbit::Logger::Severity
- Rabbit::Menu
- Rabbit::ModuleLoader
- Rabbit::NoPrintSupportError
- Rabbit::NotAvailableInterfaceError
- Rabbit::NotExistError
- Rabbit::NotFileError
- Rabbit::NotReadableError
- Rabbit::NullFrame
- Rabbit::ParseError
- Rabbit::ParseFinish
- Rabbit::Parser
- Rabbit::Parser::Base
- Rabbit::Parser::Ext
- Rabbit::Parser::Ext::AAFigure
- Rabbit::Parser::Ext::BlockDiag
- Rabbit::Parser::Ext::CodeRay
- Rabbit::Parser::Ext::CodeRay::RabbitEncoder
- Rabbit::Parser::Ext::Emacs
- Rabbit::Parser::Ext::Enscript
- Rabbit::Parser::Ext::Entity
- Rabbit::Parser::Ext::Escape
- Rabbit::Parser::Ext::Image
- Rabbit::Parser::Ext::Image::Private
- Rabbit::Parser::Ext::Inline
- Rabbit::Parser::Ext::TeX
- Rabbit::Parser::Ext::Video
- Rabbit::Parser::Image
- Rabbit::Parser::Markdown
- Rabbit::Parser::Markdown::Converter
- Rabbit::Parser::NoteSetter
- Rabbit::Parser::PDF
- Rabbit::Parser::PauseSupport
- Rabbit::Parser::RD
- Rabbit::Parser::RD::Ext
- Rabbit::Parser::RD::Ext::Base
- Rabbit::Parser::RD::Ext::BlockVerbatim
- Rabbit::Parser::RD::Ext::CharacterReference
- Rabbit::Parser::RD::Ext::Image
- Rabbit::Parser::RD::Ext::InlineVerbatim
- Rabbit::Parser::RD::Ext::Refer
- Rabbit::Parser::RD::Ext::Video
- Rabbit::Parser::RD::RD2RabbitVisitor
- Rabbit::Parser::RD::Visitor
- Rabbit::Parser::SlidePropertySetter
- Rabbit::Parser::Wiki
- Rabbit::Parser::Wiki::RabbitOutput
- Rabbit::Parser::Wiki::RabbitOutput::BlockPlugin
- Rabbit::Parser::Wiki::RabbitOutput::InlinePlugin
- Rabbit::Parser::Wiki::RabbitOutput::InlinePlugin::Private
- Rabbit::PathManipulatable
- Rabbit::Progress
- Rabbit::READMEParser
- Rabbit::RT2RabbitVisitor
- Rabbit::Renderer
- Rabbit::Renderer::Base
- Rabbit::Renderer::Color
- Rabbit::Renderer::Display
- Rabbit::Renderer::Display::Base
- Rabbit::Renderer::Display::ButtonHandler
- Rabbit::Renderer::Display::ClutterEmbed
- Rabbit::Renderer::Display::Cursor
- Rabbit::Renderer::Display::DrawingArea
- Rabbit::Renderer::Display::DrawingAreaBase
- Rabbit::Renderer::Display::DrawingAreaPrimitive
- Rabbit::Renderer::Display::DrawingAreaViewOnly
- Rabbit::Renderer::Display::GL
- Rabbit::Renderer::Display::Gesture
- Rabbit::Renderer::Display::Graffiti
- Rabbit::Renderer::Display::HookHandler
- Rabbit::Renderer::Display::Info
- Rabbit::Renderer::Display::KeyHandler
- Rabbit::Renderer::Display::Magnifier
- Rabbit::Renderer::Display::Mask
- Rabbit::Renderer::Display::Menu
- Rabbit::Renderer::Display::Progress
- Rabbit::Renderer::Display::ScrollHandler
- Rabbit::Renderer::Display::Search
- Rabbit::Renderer::Display::Spotlight
- Rabbit::Renderer::Engine
- Rabbit::Renderer::Engine::Cairo
- Rabbit::Renderer::Engine::GDK
- Rabbit::Renderer::GL
- Rabbit::Renderer::Kernel
- Rabbit::Renderer::Pixmap
- Rabbit::Renderer::Pixmap::Base
- Rabbit::Renderer::Pixmap::Cairo
- Rabbit::Renderer::Pixmap::GDK
- Rabbit::Renderer::Pixmap::GL
- Rabbit::Renderer::Print
- Rabbit::Renderer::Print::Base
- Rabbit::Renderer::Print::Cairo
- Rabbit::Renderer::Print::Layout2
- Rabbit::Renderer::Print::LayoutBase
- Rabbit::Renderer::Print::LayoutMore
- Rabbit::Renderer::Print::Multiple
- Rabbit::SOAP
- Rabbit::SOAP::Driver
- Rabbit::SOAP::Server
- Rabbit::ScreenInfo
- Rabbit::SearchWindow
- Rabbit::Searcher
- Rabbit::SlideConfiguration
- Rabbit::Source
- Rabbit::Source::ARGF
- Rabbit::Source::Base
- Rabbit::Source::File
- Rabbit::Source::Hiki
- Rabbit::Source::LimitAccessInterval
- Rabbit::Source::Memory
- Rabbit::Source::SlideShare
- Rabbit::Source::URI
- Rabbit::SourceGenerator
- Rabbit::SourceGenerator::Hiki
- Rabbit::SourceGenerator::Markdown
- Rabbit::SourceGenerator::RD
- Rabbit::SourceUnreadableError
- Rabbit::Stock
- Rabbit::SystemRunner
- Rabbit::Task
- Rabbit::Task::Slide
- Rabbit::Task::SlideShare
- Rabbit::Task::SlideShare::Error
- Rabbit::Task::Theme
- Rabbit::TeXCanNotHandleError
- Rabbit::TemporaryFile
- Rabbit::Theme
- Rabbit::Theme::Applier
- Rabbit::Theme::DirectoryEntry
- Rabbit::Theme::ElementContainer
- Rabbit::Theme::Entry
- Rabbit::Theme::FileEntry
- Rabbit::Theme::GemEntry
- Rabbit::Theme::ImageDirectoryEntry
- Rabbit::Theme::ImageFileEntry
- Rabbit::Theme::ImageGemEntry
- Rabbit::Theme::Manager
- Rabbit::Theme::Searcher
- Rabbit::ThemeConfiguration
- Rabbit::ThemeExit
- Rabbit::TrackBall
- Rabbit::TrackBall::Vector
- Rabbit::UnknownCursorTypeError
- Rabbit::UnknownPropertyError
- Rabbit::UnsupportedFormatError
- Rabbit::Utils
- Rabbit::VideoWindow
- Rabbit::VideoWindow::VideoWidget
- Rabbit::XMLRPC
- Rabbit::XMLRPC::Client
- Rabbit::XMLRPC::Server
- Rabbit::XMLRPC::Servlet
- OptionParser
- OptionParser::Category
- OptionParser::List
- OptionParser::Switch
- Cairo
- Cairo::Context
- Gtk
- Gtk::Action
- Pango
- Pango::Context
- Object

No matching classes.

# Rabbit::Parser::RD::RD2RabbitVisitor

### Constants

EXTENSIONS
INCLUDE_SUFFIX
OUTPUT_SUFFIX

  must-have constants

SYSTEM_NAME
SYSTEM_VERSION
VERSION

### Attributes

canvas[R]

### Public Class Methods

new(canvas) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 39
    def initialize(canvas)
      @canvas = canvas

      @slides = []
      @slide = nil
      @slide_property_mode = false
      @index = {}

      init_extensions
      super()
    end

### Public Instance Methods

apply_to_Code(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 224
    def apply_to_Code(element, content)
      Code.new(content)
    end

apply_to_DescList(element, items) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 153
    def apply_to_DescList(element, items)
      apply_to_List(element, items, DescriptionList)
    end

apply_to_DescListItem(element, term, description) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 180
    def apply_to_DescListItem(element, term, description)
      desc_term = DescriptionTerm.new(Paragraph.new(term))
      desc_content = DescriptionContent.new
      apply_to_ListItem(element, description, desc_content)
      DescriptionListItem.new(desc_term, desc_content)
    end

apply_to_DocumentElement(element, contents) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 57
    def apply_to_DocumentElement(element, contents)
      target = nil
      mode = :ignore
      contents.each do |content|
        case content
        when :no_element
          next
        when nil
          mode = :ignore
        when Slide
          target = content.body
          @canvas << content
          mode = :display
        when TitleSlide
          target = content
          @canvas << content
          mode = :display
        when SlidePropertySetter, NoteSetter
          target = content
          mode = :property
        else
          case mode
          when :display
            target << content
          when :property
            target.apply(content)
          end
        end
      end
      burn_out_pause_targets
      burn_out_foot_texts
    end

apply_to_Emphasis(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 220
    def apply_to_Emphasis(element, content)
      Emphasis.new(content)
    end

apply_to_EnumList(element, items) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 145
    def apply_to_EnumList(element, items)
      i = 1
      apply_to_List(element, items, EnumList) do |list, item|
        item.order = i
        i += 1
      end
    end

apply_to_EnumListItem(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 176
    def apply_to_EnumListItem(element, content)
      apply_to_ListItem(element, content, EnumListItem.new)
    end

apply_to_Footnote(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 251
    def apply_to_Footnote(element, content)
      if @slide.nil?
        Text.new("")
      else
        num = get_footnote_num(element)
        unless num
          raise ArgumentError, "[BUG?] #{element} is not registered."
        end
        add_foot_text(num, content)
        Footnote.new(num)
      end
    end

apply_to_Foottext(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 264
    def apply_to_Foottext(element, content)
      num = get_footnote_num(element)
      raise ArgumentError, "[BUG] #{element} isn't registered." unless num
      FootText.new(num, content)
    end

apply_to_Headline(element, title) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 90
    def apply_to_Headline(element, title)
      anchor = get_anchor(element)
      slide, @slide = @slide, nil
      case element.level
      when 1
        if @slides.empty?
          @slide = TitleSlide.new(Title.new(title))
        else
          @slide = Slide.new(HeadLine.new(title))
          @slide << Body.new
        end
        @foot_texts << []
        @slides << @slide
        @slide
      when 2
        if /\Anote\z/ =~ title.first.text
          NoteSetter.new(@slides.last)
        else
          SlidePropertySetter.new(@slides.last)
        end
      else
        nil
      end
    end

apply_to_Include(element) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 115
    def apply_to_Include(element)
      paths = element.tree.include_paths
      fname = search_file(element.filename, paths, @include_suffix)
      if fname
        File.open(fname) do |f|
          instance_eval(f.read, fname, 0)
        end
      end
    end

apply_to_Index(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 236
    def apply_to_Index(element, content)
      Index.new(content)
    end

apply_to_ItemList(element, items) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 141
    def apply_to_ItemList(element, items)
      apply_to_List(element, items, ItemList)
    end

apply_to_ItemListItem(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 172
    def apply_to_ItemListItem(element, content)
      apply_to_ListItem(element, content, ItemListItem.new)
    end

apply_to_Keyboard(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 232
    def apply_to_Keyboard(element, content)
      Keyboard.new(content)
    end

apply_to_List(element, items, klass) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 161
    def apply_to_List(element, items, klass)
      list = klass.new()
      items.each do |item|
        list << item
        if block_given?
          yield(list, item)
        end
      end
      list
    end

apply_to_ListItem(element, contents, item) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 194
    def apply_to_ListItem(element, contents, item)
      contents.each do |content|
        item << content
      end
      waited_paragraphs = item.elements.find_all do |element|
        element.is_a?(Paragraph) and element.have_wait_tag?
      end
      unless waited_paragraphs.empty?
        waited_paragraphs.each do |paragraph|
          paragraph.default_visible = true
          paragraph.clear_theme
          unregister_pause(paragraph)
        end

        item.default_visible = false
        item.clear_theme
        register_pause(item)
      end
      item
    end

apply_to_MethodList(element, items) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 157
    def apply_to_MethodList(element, items)
      apply_to_List(element, items, MethodList)
    end

apply_to_MethodListItem(element, term, description) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 187
    def apply_to_MethodListItem(element, term, description)
      method_term = parse_method(term)
      method_description = MethodDescription.new
      apply_to_ListItem(element, description, method_description)
      MethodListItem.new(method_term, method_description)
    end

apply_to_Reference_with_RDLabel(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 240
    def apply_to_Reference_with_RDLabel(element, content)
      source = content.collect{|elem| elem.text}
      apply_to_extension("refer", element.label, source, content)
    end

apply_to_Reference_with_URL(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 245
    def apply_to_Reference_with_URL(element, content)
      ref = ReferText.new(content)
      ref.to = element.label.url
      ref
    end

apply_to_String(str) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 277
    def apply_to_String(str)
      Parser::Ext::Escape.escape_meta_character(str)
    end

apply_to_StringElement(element) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 215
    def apply_to_StringElement(element)
      content = element.content.gsub(/\n\s*/, '')
      Text.new(apply_to_String(content))
    end

apply_to_TextBlock(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 125
    def apply_to_TextBlock(element, content)
      paragraph = Paragraph.new(content)
      register_pause(paragraph) if paragraph.have_wait_tag?
      paragraph
    end

apply_to_Var(element, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 228
    def apply_to_Var(element, content)
      Variable.new(content)
    end

apply_to_Verb(element) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 270
    def apply_to_Verb(element)
      source = apply_to_String(element.content)
      content = element.content
      apply_to_extension("inline_verbatim", element.to_label,
                         source, content)
    end

apply_to_Verbatim(element) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 131
    def apply_to_Verbatim(element)
      content = []
      element.each_line do |line|
        content << line
      end
      content_str = content.join("")
      /\A#\s*([^\n]+)(?:\n)?(?m:(.*)?)\z/ =~ content_str
      apply_to_extension("block_verbatim", $1, $2.to_s, content_str)
    end

create_have_text_element(klass, content) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 281
    def create_have_text_element(klass, content)
      raise "Why???" if content.size > 1
      klass.new(content.collect{|x| x.text}.join(""))
    end

current_body() click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 286
    def current_body
      @slide.body
    end

visit(tree) click to toggle source

    # File lib/rabbit/parser/rd/rd2rabbit-lib.rb, line 51
    def visit(tree)
      prepare_labels(tree, "label-")
      prepare_footnotes(tree)
      super(tree)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.