Class: ReverseAdoc::Converters::Figure
- Inherits:
-
Base
- Object
- Base
- ReverseAdoc::Converters::Figure
show all
- Defined in:
- lib/reverse_adoc/converters/figure.rb
Instance Method Summary
collapse
Methods inherited from Base
#escape_keychars, #treat, #treat_children
Instance Method Details
#convert(node, state = {}) ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/reverse_adoc/converters/figure.rb', line 4
def convert(node, state = {})
id = node['id']
anchor = id ? "[[#{id}]]\n" : ""
title = (node)
title = ".#{title}\n" unless title.empty?
"\n\n#{anchor}#{title}====\n" << treat_children(node, state).strip << "\n====\n\n"
end
|
12
13
14
15
16
|
# File 'lib/reverse_adoc/converters/figure.rb', line 12
def (node)
title = node.at("./figcaption")
return "" if title.nil?
treat_children(title, {})
end
|