Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (41 sloc) 1.456 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
SLIDES_DIR = 'slides/'
HTML_DIR = 'html/'
ALL_HTML = File.join(HTML_DIR, "all.html")

METADATA = File.join(SLIDES_DIR, "metadata.yml")

Dir.chdir(SLIDES_DIR) { SRC = FileList['*.slides']; SRC.resolve }

OUTPUT = []

SRC.each do |file_name|
  slide_file = File.join(SLIDES_DIR, file_name)
  html_file = File.join(HTML_DIR, file_name.ext('.html'))
  OUTPUT << html_file
  desc "Build #{html_file} from #{slide_file}"
  file html_file => [HTML_DIR, slide_file] do
    sh "ruby bin/pressie.rb #{METADATA} #{slide_file} > #{html_file}"
  end
end

desc "Build the HTML slides from all the files slides/*.slides files"
task :default => OUTPUT

desc "Build all slides based on the contents of slides/table_of_contents.slides"
task :all => [ 'tmp/', HTML_DIR, ALL_HTML, :remove_tmp ]

task ALL_HTML => 'tmp/almost_all.html' do
  sh "ruby bin/postprocess_all.rb tmp/almost_all.html >#{ALL_HTML}"
end

task 'tmp/almost_all.html' => 'tmp/almost_all.slides' do
  sh "ruby bin/pressie.rb #{METADATA} tmp/almost_all.slides >tmp/almost_all.html"
end

task 'tmp/almost_all.slides' => OUTPUT do
  sh "ruby bin/build_all.rb #{METADATA} slides/table_of_contents.slides tmp/almost_all.slides"
end

file "tmp/" do
  mkdir "tmp"
end

file "html/" do
  mkdir "html"
end

task :remove_tmp do
  FileUtils.rm_rf("tmp")
end
                       
desc "Remove all work products—slides and temporary files"
task :clean => :remove_tmp do
  FileUtils.rm_rf HTML_DIR
end
Something went wrong with that request. Please try again.