Sha256: 29ca2a2c680fca01739efec5aac4150f11094fb1886dd2efd4e6f0ead566afbd

Contents?: true

Size: 480 Bytes

Versions: 10

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module Stepmod
  module Utils
    module Converters
      class Head < ReverseAdoc::Converters::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

      ReverseAdoc::Converters.register :head, Head.new
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stepmod-utils-0.3.5 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.4 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.2 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.1 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.0 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.2.7 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.2.6 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.2.5 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.2.4 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.2.3 lib/stepmod/utils/converters/head.rb