Class: ToHiki

Inherits:
Object
  • Object
show all
Defined in:
lib/org2hiki/org2hiki.rb

Overview

convert org formatted lines to hiki

Instance Method Summary collapse

Constructor Details

#initializeToHiki

Returns a new instance of ToHiki.



4
5
6
7
# File 'lib/org2hiki/org2hiki.rb', line 4

def initialize()
  @in_example = false
  @outputs = []
end

Instance Method Details

#convert(lines) ⇒ Object

converter



10
11
12
13
14
15
16
17
18
19
# File 'lib/org2hiki/org2hiki.rb', line 10

def convert(lines)
  lines.split(/\n/).each do |line|
    next if check_block?(line)
    line = check_word line
    line = check_link line
    line = check_head line
    @outputs << line
  end
  @outputs.join("\n")
end