Module: OrgMarkup::ToHtml

Defined in:
lib/org/rules.rb

Instance Method Summary collapse

Instance Method Details



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

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

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


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

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