class Quesadilla::HTMLRenderer

Default HTML renderer for generating HTML

Public Instance Methods

code(display_text) click to toggle source

HTML representation of code @param display_text [String] the text of the code @return [String] HTML representation of the code

# File lib/quesadilla/html_renderer.rb, line 35
def code(display_text)
  %Q{<code>#{display_text}</code>}
end
double_emphasis(display_text) click to toggle source

HTML representation of bold text @param display_text [String] the bold text @return [String] HTML representation of the bold text

# File lib/quesadilla/html_renderer.rb, line 14
def double_emphasis(display_text)
  %Q{<strong>#{display_text}</strong>}
end
emphasis(display_text) click to toggle source

HTML representation of italic text @param display_text [String] the italic text @return [String] HTML representation of the italic text

# File lib/quesadilla/html_renderer.rb, line 7
def emphasis(display_text)
  %Q{<em>#{display_text}</em>}
end
hashtag(display_text, hashtag) click to toggle source

HTML representation of a hashtag @param display_text [String] the hashtag text (‘#awesome`) @param hashtag [String] the hashtag (just `awesome`) @return [String] HTML representation of the hashtag

# File lib/quesadilla/html_renderer.rb, line 43
def hashtag(display_text, hashtag)
  %Q{<a href="#hashtag-#{hashtag}" class="hashtag">#{display_text}</a>}
end
strikethrough(display_text) click to toggle source

HTML representation of strikethrough text @param display_text [String] the strikethrough text @return [String] HTML representation of the strikethrough text

# File lib/quesadilla/html_renderer.rb, line 28
def strikethrough(display_text)
  %Q{<del>#{display_text}</del>}
end
triple_emphasis(display_text) click to toggle source

HTML representation of bold italic text @param display_text [String] the bold italic text @return [String] HTML representation of the bold italic text

# File lib/quesadilla/html_renderer.rb, line 21
def triple_emphasis(display_text)
  %Q{<strong><em>#{display_text}</em></strong>}
end
user(display_text, username, user_id = nil) click to toggle source

HTML representation of a user mention @param display_text [String] the user mention text (‘@soffes`) @param username [String] the username (just `soffes`) @param user_id [String] optional user_id @return [String] HTML representation of the user mention

# File lib/quesadilla/html_renderer.rb, line 52
def user(display_text, username, user_id = nil)
  %Q{<a href="/#{username}" class="user">#{display_text}</a>}
end