Module: OrgMarkup::ToHtml
- Defined in:
- lib/org/rules.rb
Instance Method Summary collapse
- #html_link(leader, href = nil, title = nil) ⇒ Object
-
#link_file(href, title) ⇒ Object
Respond to [[file:href]] and [[file:href]].
-
#link_in(href, title) ⇒ Object
Respond to [[name]] and [[name]].
- #link_out(href, title) ⇒ Object
-
#link_rss(href, title) ⇒ Object
Respond to [[rss:href]] and [[rss:href]].
Instance Method Details
#html_link(leader, href = nil, title = nil) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/org/rules.rb', line 72 def html_link(leader, href = nil, title = nil) case leader when 'rss' link_rss(href, title) when 'file' link_file(href, title) when 'http', 'https', 'ftp' link_out("#{leader}:#{href}", title) else link_in(leader, href) end end |
#link_file(href, title) ⇒ Object
Respond to [[file:href]] and [[file:href]]
92 93 94 95 |
# File 'lib/org/rules.rb', line 92 def link_file(href, title) "<file %p %p>" % [href, title] '' end |
#link_in(href, title) ⇒ Object
Respond to [[name]] and [[name]]
103 104 105 106 |
# File 'lib/org/rules.rb', line 103 def link_in(href, title) "<wiki %p %p>" % [href, title] tag(:a, title || href, :href => "/#{href}") end |
#link_out(href, title) ⇒ Object
97 98 99 100 |
# File 'lib/org/rules.rb', line 97 def link_out(href, title) "<out %p %p>" % [href, title] tag(:a, title || href, :href => href) end |
#link_rss(href, title) ⇒ Object
Respond to [[rss:href]] and [[rss:href]]
86 87 88 89 |
# File 'lib/org/rules.rb', line 86 def link_rss(href, title) "<rss %p %p>" % [href, title] '' end |