Sha256: 44e0cf65c9eb5bae3e8461beaafc6da366a28f1598bc7fe7e342c6529642b3a3

Contents?: true

Size: 363 Bytes

Versions: 10

Compression:

Stored size: 363 Bytes

Contents

module ReverseAsciidoctor
  module Converters
    class Head < Base
      def convert(node, state = {})
        title = extract_title(node)
        "= #{title}\n:stem:\n\n"
      end

      def extract_title(node)
        title = node.at("./title")
        return "(???)" if title.nil?
        title.text
      end
    end

    register :head, Head.new
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
reverse_adoc-0.2.8 lib/reverse_asciidoctor/converters/head.rb
reverse_adoc-0.2.7 lib/reverse_asciidoctor/converters/head.rb
reverse_adoc-0.2.6 lib/reverse_asciidoctor/converters/head.rb
reverse_adoc-0.2.5 lib/reverse_asciidoctor/converters/head.rb
reverse_adoc-0.2.4 lib/reverse_asciidoctor/converters/head.rb
reverse_adoc-0.2.3 lib/reverse_asciidoctor/converters/head.rb
reverse_asciidoctor-0.2.2 lib/reverse_asciidoctor/converters/head.rb
reverse_asciidoctor-0.2.1 lib/reverse_asciidoctor/converters/head.rb
reverse_asciidoctor-0.2.0 lib/reverse_asciidoctor/converters/head.rb
reverse_asciidoctor-0.1.0 lib/reverse_asciidoctor/converters/head.rb