<commit_before>require 'sinatra'
require 'kss'

set :public_folder, Proc.new { File.join(root) }
set :views, Proc.new { File.join(root, "styleguide") }



get '/' do
  @styleguide = Kss::Parser.new('scss/')
  erb :styleguide
end

helpers do
  # Generates a styleguide block. A little bit evil with @_out_buf, but
  # if you're using something like Rails, you can write a much cleaner helper
  # very easily.
  def styleguide_block(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block)
  end

  def styleguide_block_without_preview(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block_without_preview)
  end

  def styleguide_block_without_modifiers(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block_without_modifiers)<commit_msg>Show Neue version on style guide.<commit_after>require 'sinatra'
require 'kss'
require 'json'

set :public_folder, Proc.new { File.join(root) }
set :views, Proc.new { File.join(root, "styleguide") }



get '/' do
  @package = JSON.parse( File.read('package.json') )
  @version = "v#{@package["version"]}"

  @styleguide = Kss::Parser.new('scss/')
  erb :styleguide
end

helpers do
  # Generates a styleguide block. A little bit evil with @_out_buf, but
  # if you're using something like Rails, you can write a much cleaner helper
  # very easily.
  def styleguide_block(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block)
  end

  def styleguide_block_without_preview(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block_without_preview)
  end

  def styleguide_block_without_modifiers(section, &block)
    @section = @styleguide.section(section)
    @example_html = capture{ block.call }
    @escaped_html = ERB::Util.html_escape @example_html
    @_out_buf << erb(:_styleguide_block_without_modifiers)
{'fraction_non_alphanumeric': 0.11588330632090761, 'fraction_numerical': 0.0, 'mean_word_length': 4.675862068965517, 'pattern_counts': {'":': 0, '<': 15, '<?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': '3879744', 'n_tokens_mistral': 879, 'n_tokens_neox': 881, 'n_words': 189}