Class: Docgenerator::Creole::Rubycode::Code

Inherits:
Placeholder show all
Defined in:
lib/creole/plugins/rubycode4creole.rb

Overview

Print ruby source code as is

Instance Method Summary collapse

Methods inherited from Placeholder

#<<, #close, #initialize, set_placeholder_key

Constructor Details

This class inherits a constructor from Docgenerator::Creole::Placeholder

Instance Method Details

#to_doc(target, options = {}) ⇒ Object

Return content in a verbatim environment



32
33
34
35
36
37
38
# File 'lib/creole/plugins/rubycode4creole.rb', line 32

def to_doc( target, options = {})
  codetest = Docgenerator::Rubycode::CodeTest.new(nil, @source.join )
  #~ element(:verbatim,{},@source ).cr.to_doc( target, options )
  element(:verbatim, {
      :style => 'rubycode',
    }, codetest.sourcecode ).cr.to_doc( target, options )
end