class ReverseAsciidoctor::Converters::Figure
Public Instance Methods
convert(node, state = {})
click to toggle source
# File lib/reverse_asciidoctor/converters/figure.rb, line 4 def convert(node, state = {}) id = node['id'] anchor = id ? "[[#{id}]]\n" : "" title = extract_title(node) title = ".#{title}\n" unless title.empty? "\n\n#{anchor}#{title}====\n" << treat_children(node, state).strip << "\n====\n\n" end
extract_title(node)
click to toggle source
# File lib/reverse_asciidoctor/converters/figure.rb, line 12 def extract_title(node) title = node.at("./figcaption") return "" if title.nil? treat_children(title, {}) end