<commit_before>require 'rake/clean'

# FileLists
DIR_IMAGES_FILES = FileList["images/**/*"]

revealjs = File.expand_path(File.join(File.dirname(__FILE__), '..', 'reveal.js'))
REVEAL_FILES = FileList["#{revealjs}/**/*"]

#
# task: slides
directory 'slides'
CLEAN.include 'slides'

#
# task: slides.html
desc 'Build slides.html'
file 'slides.html' => 'slides.haml' do
  processor = HamlProcessor.open 'slides.haml'
  File.open('slides.html', 'w') { |f| f << processor.html }
end
CLEAN.include 'slides.html'

#
# task: presentation
desc 'Build presentation'
task :presentation => [ 'slides', 'slides.html'] do
  cp 'slides.html', 'slides'
  cp_r REVEAL_FILES, 'slides'
  mkdir_p 'slides/images'
  cp_r DIR_IMAGES_FILES, 'slides/images'
  line_nums = {
    default_slides: {
      first: 37,
      last: 338
    }
  }
  default_slides = line_nums[:default_slides][:first]..line_nums[:default_slides][:last]
  FileSlicer.remove! 'slides/index.html', default_slides
  FileSplicer.insert! 'slides.html', into: 'slides/index.html', after: '<div class="slides">'
end<commit_msg>[move-slides-html-to-slides] Start generating slides.html in slides/<commit_after>require 'rake/clean'

# FileLists
DIR_IMAGES_FILES = FileList["images/**/*"]

revealjs = File.expand_path(File.join(File.dirname(__FILE__), '..', 'reveal.js'))
REVEAL_FILES = FileList["#{revealjs}/**/*"]

#
# task: slides
directory 'slides'
CLEAN.include 'slides'

#
# task: slides.html
desc 'Build slides.html'
file 'slides/slides.html' => [ 'slides.haml', 'slides' ] do
  processor = HamlProcessor.open 'slides.haml'
  File.open('slides/slides.html', 'w') { |f| f << processor.html }
end
CLEAN.include 'slides/slides.html'

#
# task: presentation
desc 'Build presentation'
task :presentation => [ 'slides/slides.html'] do
  cp_r REVEAL_FILES, 'slides'
  mkdir_p 'slides/images'
  cp_r DIR_IMAGES_FILES, 'slides/images'
  line_nums = {
    default_slides: {
      first: 37,
      last: 338
    }
  }
  default_slides = line_nums[:default_slides][:first]..line_nums[:default_slides][:last]
  FileSlicer.remove! 'slides/index.html', default_slides
  FileSplicer.insert! 'slides/slides.html', into: 'slides/index.html', after: '<div class="slides">'
end
{'fraction_non_alphanumeric': 0.16749886518384022, 'fraction_numerical': 0.004539264639128461, 'mean_word_length': 4.846153846153846, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '891342', 'n_tokens_mistral': 873, 'n_tokens_neox': 843, 'n_words': 153}