Class: Rabbit::SourceGenerator::Hiki
- Inherits:
-
Object
- Object
- Rabbit::SourceGenerator::Hiki
- Includes:
- GetText, PathManipulatable
- Defined in:
- lib/rabbit/source-generator/hiki.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) ⇒ Hiki
constructor
A new instance of Hiki.
- #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/hiki.rb', line 25 def logger @logger end |
Instance Method Details
#comment(content) ⇒ Object
58 59 60 |
# File 'lib/rabbit/source-generator/hiki.rb', line 58 def comment(content) "// #{content}" end |
#definition_list_item(item, description) ⇒ Object
34 35 36 |
# File 'lib/rabbit/source-generator/hiki.rb', line 34 def definition_list_item(item, description) ":#{item}:#{description}" end |
#heading(level, title) ⇒ Object
30 31 32 |
# File 'lib/rabbit/source-generator/hiki.rb', line 30 def heading(level, title) ("!" * level) + " #{title}" end |
#image(source, options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rabbit/source-generator/hiki.rb', line 42 def image(source, ={}) lines = [ "{{image(#{source.dump},", " {", ] .each do |key, value| lines << " #{key.to_s.dump} => #{value.inspect}," end lines << " })}}" lines.join("\n") end |
#preformatted_line(content) ⇒ Object
54 55 56 |
# File 'lib/rabbit/source-generator/hiki.rb', line 54 def preformatted_line(content) " #{content}" end |
#unordered_list_item(item) ⇒ Object
38 39 40 |
# File 'lib/rabbit/source-generator/hiki.rb', line 38 def unordered_list_item(item) "* #{item}" end |