module Ore::Template::Helpers::RDoc

@api semipublic

@since 0.10.0

Public Instance Methods

h1(title) click to toggle source

Emits a RDoc h1 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 43
def h1(title)
  "= #{title}"
end
h2(title) click to toggle source

Emits a RDoc h2 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 54
def h2(title)
  "== #{title}"
end
h3(title) click to toggle source

Emits a RDoc h3 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 65
def h3(title)
  "=== #{title}"
end
h4(title) click to toggle source

Emits a RDoc h4 heading.

@param [String] title

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 76
def h4(title)
  "==== #{title}"
end
image(url,alt=nil) click to toggle source

Emits a RDoc image.

@param [String] url

@param [String, nil] alt

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 32
def image(url,alt=nil)
  "{#{alt}}[rdoc-image:#{url}]"
end
pre(code) click to toggle source

Emits a RDoc code block.

@param [String] code

@yield []

The return value of the given block will be used as the code.

@return [String]

# File lib/ore/template/helpers/rdoc.rb, line 90
def pre(code)
  code.each_line.map { |line| "  #{line}" }.join
end