Sha256: 5766cb2f06aa133a9d00fe244b569f995d9e1648a4cbaf3e4b46d9e80133a399
Contents?: true
Size: 550 Bytes
Versions: 9
Compression:
Stored size: 550 Bytes
Contents
module ReverseAdoc module Converters class Figure < Base 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 def extract_title(node) title = node.at("./figcaption") return "" if title.nil? treat_children(title, {}) end end register :figure, Figure.new end end
Version data entries
9 entries across 9 versions & 1 rubygems