Sha256: 12e89203b3533088fe8ae5b9b0b9c5b9a641d4597979ee5a3bfa66f3a682b6fd
Contents?: true
Size: 618 Bytes
Versions: 2
Compression:
Stored size: 618 Bytes
Contents
module ReverseAdoc module Converters class Figure < Base def to_coradoc(node, state = {}) id = node["id"] title = extract_title(node) content = treat_children_coradoc(node, state) Coradoc::Element::Block::Example.new(title, lines: content, id: id) end def convert(node, state = {}) Coradoc::Generator.gen_adoc(to_coradoc(node, state)) end def extract_title(node) title = node.at("./figcaption") return "" if title.nil? treat_children_coradoc(title, {}) end end register :figure, Figure.new end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reverse_adoc-1.0.1 | lib/reverse_adoc/converters/figure.rb |
reverse_adoc-1.0.0 | lib/reverse_adoc/converters/figure.rb |