Class: Tilt::RDocTemplate
Overview
RDoc template. See: rdoc.rubyforge.org/
It’s suggested that your program ‘require ’rdoc/markup’‘ and `require ’rdoc/markup/to_html’‘ at load time when using this template engine in a threaded environment.
Instance Attribute Summary
Attributes inherited from Template
#data, #file, #line, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Template
#basename, #default_encoding, #eval_file, #initialize, #name, #read_template_file, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Class Method Details
.engine_initialized? ⇒ Boolean
13
14
15
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 13
def self.engine_initialized?
defined? ::RDoc::Markup::ToHtml
end
|
Instance Method Details
#allows_script? ⇒ Boolean
43
44
45
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 43
def allows_script?
false
end
|
#evaluate(scope, locals, &block) ⇒ Object
39
40
41
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 39
def evaluate(scope, locals, &block)
@output ||= @engine.to_s
end
|
#initialize_engine ⇒ Object
17
18
19
20
21
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 17
def initialize_engine
require_template_library 'rdoc'
require_template_library 'rdoc/markup'
require_template_library 'rdoc/markup/to_html'
end
|
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 23
def markup
begin
require 'rdoc/options'
RDoc::Markup::ToHtml.new(RDoc::Options.new, nil)
rescue ArgumentError
RDoc::Markup::ToHtml.new
end
end
|
34
35
36
37
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/rdoc.rb', line 34
def prepare
@engine = markup.convert(data)
@output = nil
end
|