Module: Ore::Template::Helpers::Textile
- Defined in:
- lib/ore/template/helpers/textile.rb
Overview
Instance Method Summary collapse
-
#h1(title) ⇒ String
Emits a Textile h1 heading.
-
#h2(title) ⇒ String
Emits a Textile h2 heading.
-
#h3(title) ⇒ String
Emits a Textile h3 heading.
-
#h4(title) ⇒ String
Emits a Textile h4 heading.
-
#image(url, alt = nil) ⇒ String
Emits a Textile image tag.
-
#link_to(text, url) ⇒ String
Emits a Textile link.
-
#pre(code) { ... } ⇒ String
Emits a Textile code block.
Instance Method Details
#h1(title) ⇒ String
Emits a Textile h1 heading.
49 50 51 |
# File 'lib/ore/template/helpers/textile.rb', line 49 def h1(title) "h1. #{title}" end |
#h2(title) ⇒ String
Emits a Textile h2 heading.
60 61 62 |
# File 'lib/ore/template/helpers/textile.rb', line 60 def h2(title) "h2. #{title}" end |
#h3(title) ⇒ String
Emits a Textile h3 heading.
71 72 73 |
# File 'lib/ore/template/helpers/textile.rb', line 71 def h3(title) "h3. #{title}" end |
#h4(title) ⇒ String
Emits a Textile h4 heading.
82 83 84 |
# File 'lib/ore/template/helpers/textile.rb', line 82 def h4(title) "h4. #{title}" end |
#image(url, alt = nil) ⇒ String
Emits a Textile image tag.
36 37 38 39 40 |
# 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) ⇒ String
Emits a Textile link.
19 20 21 22 23 24 25 |
# 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) { ... } ⇒ String
Emits a Textile code block.
96 97 98 99 100 101 102 |
# File 'lib/ore/template/helpers/textile.rb', line 96 def pre(code) if code =~ /#{$/}\s*#{$/}/ "bc.. #{code}" else "bc. #{code}" end end |