Sha256: 84ef4f4519602507b2f154baf31c7ac79c1ca8adad6c25d203db7802ce503476

Contents?: true

Size: 483 Bytes

Versions: 38

Compression:

Stored size: 483 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

38 entries across 38 versions & 1 rubygems

Version Path
stepmod-utils-0.4.8 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.7 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.6 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.5 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.2 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.1 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.4.0 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.37 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.36 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.35 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.34 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.33 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.32 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.31 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.30 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.29 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.28 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.27 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.26 lib/stepmod/utils/converters/head.rb
stepmod-utils-0.3.25 lib/stepmod/utils/converters/head.rb