<commit_before>require 'erb'

module Octodown
  module Renderer
    class HTML
      attr_reader :rendered_markdown, :template

      def initialize(rendered_markdown, template: 'markdown-preview')
        @rendered_markdown = rendered_markdown
        @template = template
      end

      def render
        template_text = File.read template_filepath
        erb_template = ERB.new template_text
        erb_template.result binding
      end

      def title
        'True Github Markdown Preview'
      end

      def stylesheet
        stylesheet_file = File.join Octodown.root, 'assets',
          "#{template}.css"
        File.read stylesheet_file
      end

      private

      def parent_dir
        current_file = File.dirname __FILE__
        File.expand_path '..', current_file
      end

      def template_filepath
        File.join parent_dir, 'template', "#{template}.erb"
      end
    end
  end
end<commit_msg>Hardcode github template for now<commit_after>require 'erb'

module Octodown
  module Renderer
    class HTML
      attr_reader :rendered_markdown, :template

      def initialize(rendered_markdown, template: 'github')
        @rendered_markdown = rendered_markdown
        @template = template
      end

      def render
        template_text = File.read template_filepath
        erb_template = ERB.new template_text
        erb_template.result binding
      end

      def title
        'True Github Markdown Preview'
      end

      def stylesheet
        stylesheet_file = File.join Octodown.root, 'assets',
          'github.css'
        File.read stylesheet_file
      end

      private

      def parent_dir
        current_file = File.dirname __FILE__
        File.expand_path '..', current_file
      end

      def template_filepath
        File.join parent_dir, 'template', "#{template}.erb"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0611587982832618, 'fraction_numerical': 0.0, 'mean_word_length': 2.20446735395189, 'pattern_counts': {'":': 0, '<': 3, '<?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': '493661', 'n_tokens_mistral': 541, 'n_tokens_neox': 509, 'n_words': 137}