<commit_before>module GfmLivePreview
  class Server < ::Sinatra::Application
    enable :inline_templates
    set :port, GfmLivePreview.config.fetch(:port)
    set :sockets, []

    def syntax_highlight! str
      SyntaxHighlighter.highlight! str do |string, hexcolor|
        "<span style=\"color:##{hexcolor}\">#{string}</span>"
      end
    rescue => e
      puts "Exception during syntax highlighting: #{e}"
      e.backtrace.each do |line| puts line; end
    end

    def render_readme_html
      readme_md = File.read ::GfmLivePreview.file
      syntax_highlight! readme_md
      GitHub::Markdown.render_gfm readme_md
    end

    def doc_path<commit_msg>Bind on 0.0.0.0<commit_after>module GfmLivePreview
  class Server < ::Sinatra::Application
    enable :inline_templates
    set :bind, "0.0.0.0"
    set :port, GfmLivePreview.config.fetch(:port)
    set :sockets, []

    def syntax_highlight! str
      SyntaxHighlighter.highlight! str do |string, hexcolor|
        "<span style=\"color:##{hexcolor}\">#{string}</span>"
      end
    rescue => e
      puts "Exception during syntax highlighting: #{e}"
      e.backtrace.each do |line| puts line; end
    end

    def render_readme_html
      readme_md = File.read ::GfmLivePreview.file
      syntax_highlight! readme_md
      GitHub::Markdown.render_gfm readme_md
    end

    def doc_path
{'fraction_non_alphanumeric': 0.1080680977054034, 'fraction_numerical': 0.005921539600296077, 'mean_word_length': 3.147239263803681, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4867531', 'n_tokens_mistral': 441, 'n_tokens_neox': 435, 'n_words': 104}