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



38
39
40
# File 'lib/protos/markdown/table.rb', line 38

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

#visit_strong(node) ⇒ Object



42
43
44
# File 'lib/protos/markdown/table.rb', line 42

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

#visit_table(node) ⇒ Object



6
7
8
# File 'lib/protos/markdown/table.rb', line 6

def visit_table(node)
  visit_children(node)
end

#visit_table_cell(node) ⇒ Object



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

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

#visit_table_header(node) ⇒ Object



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

def visit_table_header(node)
  @inside_header = true

  header do
    visit_children(node)
  end
end

#visit_table_row(node) ⇒ Object



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

def visit_table_row(node)
  @inside_header = false

  row do
    visit_children(node)
  end
end

#visit_text(node) ⇒ Object



26
27
28
# File 'lib/protos/markdown/table.rb', line 26

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