<commit_before>require "redcarpet"
require "active_support/core_ext"

Dir["./lib/*"].each{|f| require f }

# Debugging
set(:logging, ENV['RACK_ENV'] != 'production')


set :markdown_engine, :redcarpet
set :markdown, :layout_engine => :erb,
         :fenced_code_blocks => true,
         :lax_html_blocks => true,
         :renderer => Highlighter::HighlightedHTML.new

activate :directory_indexes
activate :toc
activate :highlighter

activate :api_docs,
  :default_class => "Ember",
  :repo_url => "https://github.com/emberjs/ember.js"


###
# Blog
###

activate :blog do |blog|
  blog.prefix = "blog"
  blog.layout = "blog_layout"
  blog.summary_separator = %r{(<p>READMORE</p>)} # Markdown adds the <p>
end

page "/blog/feed.xml", :layout => false


###
# Pages
###

page "/doc*" do
  @chapters = data.docs.chapters
end 

data.guides.each do |guide_name, properties|
  page "/guides/#{guide_name}", :proxy => "guide.html" do
    @guide = guide_name
  end
end

page "community.html" do
  @chapters = data.community.chapters
end

# Is this used?
page "examples/*", :directory_index => false

page "index.html", :proxy => "about.html"

page "404.html", :directory_index => false



###
# Helpers
###<commit_msg>Don't attempt to build layout files<commit_after>require "redcarpet"
require "active_support/core_ext"

Dir["./lib/*"].each{|f| require f }

# Debugging
set(:logging, ENV['RACK_ENV'] != 'production')


set :markdown_engine, :redcarpet
set :markdown, :layout_engine => :erb,
         :fenced_code_blocks => true,
         :lax_html_blocks => true,
         :renderer => Highlighter::HighlightedHTML.new

activate :directory_indexes
activate :toc
activate :highlighter

activate :api_docs,
  :default_class => "Ember",
  :repo_url => "https://github.com/emberjs/ember.js"


###
# Blog
###

activate :blog do |blog|
  blog.prefix = "blog"
  blog.layout = "blog_layout"
  blog.summary_separator = %r{(<p>READMORE</p>)} # Markdown adds the <p>
end

page "/blog/feed.xml", :layout => false


###
# Pages
###

page "/doc*" do
  @chapters = data.docs.chapters
end 

data.guides.each do |guide_name, properties|
  page "/guides/#{guide_name}", :proxy => "guide.html" do
    @guide = guide_name
  end
end

page "community.html" do
  @chapters = data.community.chapters
end

page "index.html", :proxy => "about.html"

page "404.html", :directory_index => false


# Don't build layouts standalone
ignore "*_layout.erb"

# Don't build API layouts
ignore "api/class.html.erb"
ignore "api/module.html.erb"



###
# Helpers
###
{'fraction_non_alphanumeric': 0.1622372074573582, 'fraction_numerical': 0.002380007933359778, 'mean_word_length': 4.17864476386037, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 30, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7261856', 'n_tokens_mistral': 943, 'n_tokens_neox': 890, 'n_words': 208}