module Ore::Template::Helpers::Textile
@api semipublic
@since 0.10.0
Public Instance Methods
h1(title)
click to toggle source
Emits a Textile
h1 heading.
@param [String] title
@return [String]
# File lib/ore/template/helpers/textile.rb, line 49 def h1(title) "h1. #{title}" end
h2(title)
click to toggle source
Emits a Textile
h2 heading.
@param [String] title
@return [String]
# File lib/ore/template/helpers/textile.rb, line 60 def h2(title) "h2. #{title}" end
h3(title)
click to toggle source
Emits a Textile
h3 heading.
@param [String] title
@return [String]
# File lib/ore/template/helpers/textile.rb, line 71 def h3(title) "h3. #{title}" end
h4(title)
click to toggle source
Emits a Textile
h4 heading.
@param [String] title
@return [String]
# File lib/ore/template/helpers/textile.rb, line 82 def h4(title) "h4. #{title}" end
image(url,alt=nil)
click to toggle source
Emits a Textile
image tag.
@param [String] url
@param [String, nil] alt
@return [String]
# File lib/ore/template/helpers/textile.rb, line 36 def image(url,alt=nil) if alt then "!#{url}(#{alt})!" else "!#{url}!" end end
link_to(text,url)
click to toggle source
Emits a Textile
link.
@param [String, nil] text
@param [String] url
@return [String]
# File lib/ore/template/helpers/textile.rb, line 19 def link_to(text,url) if text "#{text.dump}:#{url}" else url end end
pre(code)
click to toggle source
Emits a Textile
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/textile.rb, line 96 def pre(code) if code =~ /#{$/}\s*#{$/}/ "bc.. #{code}" else "bc. #{code}" end end