lib/asciidoctor-epub3/converter.rb in asciidoctor-epub3-1.5.0.alpha.4 vs lib/asciidoctor-epub3/converter.rb in asciidoctor-epub3-1.5.0.alpha.5

- old
+ new

@@ -31,12 +31,11 @@ Packager.new spine_doc, (spine_doc.references[:spine_items] || [spine_doc]), spine_doc.attributes['ebook-format'].to_sym end # FIXME we have to package in write because we don't have access to target before this point def write packager, target - # NOTE we use dirname of target since filename is calculated automatically - packager.package validate: @validate, extract: @extract, to_dir: (::File.dirname target) + packager.package validate: @validate, extract: @extract, target: target nil end end # Public: The converter for the epub3 backend that converts the individual @@ -311,9 +310,15 @@ %(<div class="example"> #{title_div}<div class="example-content"> #{convert_content node} </div> </div>) + end + + def floating_title node + tag_name = %(h#{node.level + 1}) + id_attribute = node.id ? %( id="#{node.id}") : nil + %(<#{tag_name}#{id_attribute} class="#{['discrete', node.role].compact * ' '}">#{node.title}</#{tag_name}>) end def listing node figure_classes = ['listing'] figure_classes << 'coalesce' if node.option? 'unbreakable'