<commit_before>module Jekyll
  class EmailPost < Page
    def initialize(site, base, dir, post)
        require 'kramdown'
      @site = site
      @base = base
      @dir = dir
      @name = 'email.html'
      self.process(@name)
      self.read_yaml(File.join(base, '_layouts'), 'email.html')
      self.data['body'] = Kramdown::Document.new(post.content).to_html.gsub(/\n/, "")
      self.data['canonical_url'] = post.url
    end
  end

  class AmpGenerator < Generator
    priority :low
    def generate(site)
      site.posts.docs.each do |post|
        index = EmailPost.new(site, site.source, post.id, post)
        index.render(site.layouts, site.site_payload)
        index.write(site.dest)
        site.pages << index
      end
    end
  end
end<commit_msg>format email plugin<commit_after>module Jekyll
    class EmailPost < Page
        def initialize(site, base, dir, post)
            require 'kramdown'
            @site = site
            @base = base
            @dir = dir
            @name = 'email.html'
            self.process(@name)
            self.read_yaml(File.join(base, '_layouts'), 'email.html')
            self.data['body'] = Kramdown::Document.new(post.content).to_html
            self.data['canonical_url'] = post.url
        end
    end

    class AmpGenerator < Generator
        priority :low
        def generate(site)
            site.posts.docs.each do |post|
                index = EmailPost.new(site, site.source, post.id, post)
                index.render(site.layouts, site.site_payload)
                index.write(site.dest)
                site.pages << index
            end
        end
    end
end
{'fraction_non_alphanumeric': 0.11461491813220133, 'fraction_numerical': 0.0, 'mean_word_length': 1.9359430604982206, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '889104', 'n_tokens_mistral': 505, 'n_tokens_neox': 496, 'n_words': 109}