Sha256: 048cafdbce2d71461a16b5a378d0db4c2381c6e124c4fbaf933daa2ae744f9cc

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

module Hanamimastery
  module CLI
    module Transformations
      class ToPRO
        # TODO: Make it Configurable
        HOST = "https://hanamimastery.com"

        # Transforms Markdown input to output compatible with Notion
        #
        def call(id, content)
          image_patern = /\!(\[\[)(.+)(\]\])/
          content
            .gsub(image_pattern, "![#{'\2'.humanize.tr('-', ''))}](#{HOST}/images/episodes/#{id})")
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanamimastery-cli-0.4.0 lib/hanamimastery/cli/transformations/to_notion.rb