Class: Protos::Markdown::Table

Inherits:
Table
  • Object
show all
Defined in:
lib/protos/markdown/table.rb

Instance Method Summary collapse

Instance Method Details

#visit_code(node) ⇒ Object



40
41
42
# File 'lib/protos/markdown/table.rb', line 40

def visit_code(node)
  code { node.string_content }
end

#visit_strong(node) ⇒ Object



44
45
46
# File 'lib/protos/markdown/table.rb', line 44

def visit_strong(node)
  strong { visit_children(node) }
end

#visit_table(node) ⇒ Object



8
9
10
# File 'lib/protos/markdown/table.rb', line 8

def visit_table(node)
  visit_children(node)
end

#visit_table_cell(node) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/protos/markdown/table.rb', line 20

def visit_table_cell(node)
  if @inside_header
    head { visit_children(node) }
  else
    cell { visit_children(node) }
  end
end

#visit_table_header(node) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/protos/markdown/table.rb', line 12

def visit_table_header(node)
  @inside_header = true

  header do
    visit_children(node)
  end
end

#visit_table_row(node) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/protos/markdown/table.rb', line 32

def visit_table_row(node)
  row do
    visit_children(node)
  end

  @inside_header = false
end

#visit_text(node) ⇒ Object



28
29
30
# File 'lib/protos/markdown/table.rb', line 28

def visit_text(node)
  plain(node.string_content)
end