Class: Malt::Engine::RDoc

Inherits:
Abstract show all
Defined in:
lib/malt/engines/rdoc.rb

Overview

RDoc template.

http://rdoc.rubyforge.org/

It’s suggested that your program require ‘rdoc/markup’ and ‘rdoc/markup/to_html’ at load time when using this template engine.

Instance Attribute Summary

Attributes inherited from Abstract

#settings

Instance Method Summary collapse

Methods inherited from Abstract

#cache?, default, #initialize, #prepare_engine, register, type

Constructor Details

This class inherits a constructor from Malt::Engine::Abstract

Instance Method Details

#create_engine(params = {}) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/malt/engines/rdoc.rb', line 29

def create_engine(params={})
  into = parameters(params, :to)

  cached(into) do
    ::RDoc::Markup::ToHtml.new
  end
end

#render(params = {}) ⇒ Object

Convert rdoc text to html.



17
18
19
20
21
22
23
24
25
26
# File 'lib/malt/engines/rdoc.rb', line 17

def render(params={})
  into, text = parameters(params, :to, :text)

  case into
  when :html, nil
    prepare_engine(params).convert(text).to_s
  else
    super(params)
  end
end