Class: Rabbit::SourceGenerator::Markdown
- Inherits:
-
Object
- Object
- Rabbit::SourceGenerator::Markdown
- Includes:
- GetText, PathManipulatable
- Defined in:
- lib/rabbit/source-generator/markdown.rb
Constant Summary
Constants included from GetText
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #comment(content) ⇒ Object
- #definition_list_item(item, description) ⇒ Object
- #heading(level, title) ⇒ Object
- #image(source, options = {}) ⇒ Object
-
#initialize(logger = nil) ⇒ Markdown
constructor
A new instance of Markdown.
- #preformatted_line(content) ⇒ Object
- #unordered_list_item(item) ⇒ Object
Methods included from GetText
Constructor Details
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
25 26 27 |
# File 'lib/rabbit/source-generator/markdown.rb', line 25 def logger @logger end |
Instance Method Details
#comment(content) ⇒ Object
56 57 58 |
# File 'lib/rabbit/source-generator/markdown.rb', line 56 def comment(content) "" end |
#definition_list_item(item, description) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/rabbit/source-generator/markdown.rb', line 34 def definition_list_item(item, description) [ item, ": #{description}", ].join("\n") end |
#heading(level, title) ⇒ Object
30 31 32 |
# File 'lib/rabbit/source-generator/markdown.rb', line 30 def heading(level, title) ("#" * level) + " #{title}" end |
#image(source, options = {}) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/rabbit/source-generator/markdown.rb', line 45 def image(source, ={}) parameters = .collect do |key, value| "#{key}='#{value}'" end "![](#{source}){:#{parameters.join(' ')}}" end |
#preformatted_line(content) ⇒ Object
52 53 54 |
# File 'lib/rabbit/source-generator/markdown.rb', line 52 def preformatted_line(content) " #{content}" end |
#unordered_list_item(item) ⇒ Object
41 42 43 |
# File 'lib/rabbit/source-generator/markdown.rb', line 41 def unordered_list_item(item) "* #{item}" end |