Class: Apiculture::AppDocumentation::TaggedMarkdown
- Inherits:
-
Struct
- Object
- Struct
- Apiculture::AppDocumentation::TaggedMarkdown
- Defined in:
- lib/apiculture/app_documentation.rb
Instance Attribute Summary collapse
-
#section_class ⇒ Object
Returns the value of attribute section_class.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
Instance Attribute Details
#section_class ⇒ Object
Returns the value of attribute section_class
5 6 7 |
# File 'lib/apiculture/app_documentation.rb', line 5 def section_class @section_class end |
#string ⇒ Object
Returns the value of attribute 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_html ⇒ Object
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_markdown ⇒ Object
6 7 8 |
# File 'lib/apiculture/app_documentation.rb', line 6 def to_markdown string.to_markdown.to_s rescue string.to_s end |