lib/kitabu/generator.rb in kitabu-1.0.0.rc1 vs lib/kitabu/generator.rb in kitabu-1.0.0.rc2

- old
+ new

@@ -12,29 +12,28 @@ def self.source_root File.dirname(__FILE__) + "/../../templates" end - def copy_template_files + def copy_html_templates copy_file "layout.erb" , "templates/html/layout.erb" copy_file "layout.css" , "templates/html/layout.css" copy_file "user.css" , "templates/html/user.css" + copy_file "syntax.css" , "templates/html/syntax.css" + end + + def copy_epub_templates copy_file "cover.erb" , "templates/epub/cover.erb" - copy_file "epub.css" , "templates/epub/style.css" + copy_file "epub.css" , "templates/epub/user.css" copy_file "epub.erb" , "templates/epub/page.erb" - - create_file "templates/html/syntax.css" do - String.new.tap do |s| - Dir[File.dirname(__FILE__) + "/../../templates/styles/*.css"].each do |file| - s << "/*== #{File.basename(file)} ==*/\n" - s << File.read(file) - s << "\n\n" - end - end - end + copy_file "cover.png" , "templates/epub/cover.png" end + def copy_sample_page + copy_file "sample.md" , "text/01_Welcome.md" + end + def copy_config_file @name = full_name @uid = Digest::MD5.hexdigest("#{Time.now}--#{rand}") @year = Date.today.year template "config.erb", "config/kitabu.yml" @@ -45,21 +44,19 @@ end def create_directories empty_directory "output" empty_directory "images" - empty_directory "text" empty_directory "code" end def create_git_files create_file ".gitignore" do - "output/*.{html,epub,pdf}\n" + "output/*.{html,epub,pdf}\noutput/tmp" end create_file "output/.gitkeep" create_file "images/.gitkeep" - create_file "text/.gitkeep" create_file "code/.gitkeep" end private # Retrieve user's name using finger.