Class: Apiculture::AppDocumentation::TaggedMarkdown

Inherits:
Struct
  • Object
show all
Defined in:
lib/apiculture/app_documentation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#section_classObject

Returns the value of attribute section_class

Returns:

  • (Object)

    the current value of section_class



5
6
7
# File 'lib/apiculture/app_documentation.rb', line 5

def section_class
  @section_class
end

#stringObject

Returns the value of attribute string

Returns:

  • (Object)

    the current value of string



5
6
7
# File 'lib/apiculture/app_documentation.rb', line 5

def string
  @string
end

Instance Method Details

#render_markdown(s) ⇒ Object



14
15
16
# File 'lib/apiculture/app_documentation.rb', line 14

def render_markdown(s)
  GitHub::Markup.render('section.markdown', s.to_s)
end

#to_htmlObject



10
11
12
# File 'lib/apiculture/app_documentation.rb', line 10

def to_html
  '<section class="%s">%s</section>' % [Rack::Utils.escape_html(section_class), render_markdown(to_markdown)]
end

#to_markdownObject



6
7
8
# File 'lib/apiculture/app_documentation.rb', line 6

def to_markdown
  string.to_markdown.to_s rescue string.to_s
end