Permalink
Browse files

Merge branch 'v4'

  • Loading branch information...
jtimberman committed Feb 10, 2012
2 parents 570d40e + 3b8a124 commit 4c1874c46c761b583ec400bfff334b3b19b64682
Showing with 22,897 additions and 3,323 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 Gemfile
  3. +108 −0 Rakefile
  4. +0 −964 guides/handholder-exercises.md
  5. +7 −1 guides/prerequisites.md
  6. +1 −1 guides/student-exercises/adding-cookbooks.md
  7. +39 −19 guides/student-exercises/anatomy-of-a-chef-run.md
  8. +72 −0 guides/student-exercises/chef-node.md
  9. +59 −0 guides/student-exercises/cookbooks-recipes-resources.md
  10. +11 −7 guides/student-exercises/getting-started.md
  11. +79 −0 guides/student-exercises/more-cookbooks.md
  12. +100 −0 guides/student-exercises/multiple-nodes-and-search.md
  13. +78 −0 guides/student-exercises/resources-in-depth.md
  14. +15 −8 guides/student-exercises/roles.md
  15. +7 −5 guides/student-exercises/troubleshooting.md
  16. +20 −0 image-src/README.md
  17. +1,334 −0 image-src/anatomy-of-chef-run.graffle
  18. +2,392 −0 image-src/authn-flow.graffle
  19. +1,695 −0 image-src/bare-metal-cloud.graffle
  20. +1,351 −0 image-src/bare-metal.graffle
  21. +1,161 −0 image-src/chef-basics-cookbook.graffle
  22. +2,563 −0 image-src/chef-server-arch.graffle
  23. +856 −0 image-src/chef-server-url-config.graffle
  24. +3,559 −0 image-src/complex-infrastructure.graffle
  25. +1,416 −0 image-src/doing-their-job.graffle
  26. +1,680 −0 image-src/integrated-systems.graffle
  27. +306 −0 image-src/third-party-services.graffle
  28. +0 −73 slides/Rakefile
  29. +0 −191 slides/adding-a-new-node/01_slide.md
  30. +0 −532 slides/adding-cookbooks/01_slide.md
  31. BIN slides/adding-cookbooks/down-arrow.png
  32. +294 −0 slides/additional-topics/01_slide.md
  33. +58 −46 slides/anatomy-of-a-chef-run/01_slide.md
  34. BIN slides/anatomy-of-a-chef-run/authn-flow.png
  35. +83 −8 slides/base.css
  36. +470 −0 slides/chef-node/01_slide.md
  37. +343 −0 slides/cookbooks-recipes-resources/01_slide.md
  38. +0 −192 slides/data-bags/01_slide.md
  39. +0 −310 slides/example-cookbook/01_slide.md
  40. +434 −356 slides/getting-started/01_slide.md
  41. BIN slides/{getting-started → images}/5-free-nodes.png
  42. BIN slides/{anatomy-of-a-chef-run → images}/anatomy-of-chef-run.png
  43. BIN slides/images/authn-flow.png
  44. BIN slides/images/bare-metal-cloud.png
  45. BIN slides/images/bare-metal.png
  46. BIN slides/images/chef-basics-cookbook.png
  47. BIN slides/{getting-started → images}/chef-server-arch.png
  48. BIN slides/images/chef-server-url-config.png
  49. BIN slides/images/complex-infrastructure.png
  50. BIN slides/images/doing-their-job.png
  51. BIN slides/{getting-started → images}/email-verified.png
  52. BIN slides/{getting-started → images}/free-trial.png
  53. BIN slides/{getting-started → images}/generate-knife-config.png
  54. BIN slides/{getting-started → images}/generate-validation-key.png
  55. BIN slides/{example-cookbook → images}/getting-cookbooks.png
  56. BIN slides/{getting-started → images}/hosted-chef-signup.png
  57. BIN slides/images/integrated-systems.png
  58. BIN slides/{getting-started → images}/manage-console-user-login.png
  59. BIN slides/{getting-started → images}/next-steps.png
  60. BIN slides/images/oc-chef-logo.png
  61. BIN slides/{getting-started → images}/policy-driven-process.png
  62. BIN slides/{getting-started → images}/select-organizations.png
  63. BIN slides/{getting-started → images}/signup-about.png
  64. BIN slides/images/third-party-services.png
  65. BIN slides/{getting-started → images}/user-get-private-key.png
  66. BIN slides/{getting-started → images}/working-with-chef.png
  67. +0 −175 slides/introduction-to-search/01_slide.md
  68. +319 −51 slides/introduction/01_slide.md
  69. +236 −11 slides/just-enough-ruby-for-chef/01_slide.md
  70. +361 −0 slides/more-cookbooks/01_slide.md
  71. +347 −0 slides/multiple-nodes-and-search/01_slide.md
  72. +0 −188 slides/node-attributes/01_slide.md
  73. +761 −0 slides/resources-in-depth/01_slide.md
  74. +27 −17 slides/roles/01_slide.md
  75. +8 −7 slides/showoff.json
  76. +244 −161 slides/troubleshooting/01_slide.md
View
@@ -2,3 +2,5 @@
Gemfile.lock
pages/
keynote/
slides/html
guides/html
View
@@ -1,5 +1,6 @@
source :rubygems
gem "showoff", "~> 0.7.0"
gem "redcarpet"
gem "pdfkit"
gem "chef"
gem "knife-ec2"
View
108 Rakefile
@@ -0,0 +1,108 @@
# -*- coding: utf-8 -*-
require "fileutils"
require 'redcarpet'
require 'json'
desc "Create the directory and initial slides (with SECTION=name)"
task :mksection do
section = ENV['SECTION']
slides_dir = File.join(File.dirname(__FILE__), "slides", section)
guides_dir = File.join(File.dirname(__FILE__), "guides", "student-exercises")
puts "** Creating section #{section} **"
FileUtils.mkdir_p(slides_dir)
FileUtils.mkdir_p(guides_dir)
unless File.exists?(File.join(slides_dir, "01_slide.md"))
puts "- populating slide template #{slides_dir}/01_slide.md"
File.open(File.join(slides_dir, "01_slide.md"), "a+") do |f|
f.puts "# #{section_header(section)}\n\n"
f.puts "Section Objectives:\n"
f.puts copyright_header
f.puts "# Summary\n\n\n"
f.puts "# Questions\n\n*\n\n"
f.puts "# Additional Resources\n\n*\n\n"
f.puts "# Lab Exercise\n\n"
f.puts section_header(section)
end
puts "- populating exercises #{File.join(guides_dir, section)}.md"
File.open(File.join(guides_dir, "#{section}.md"), "a+") do |g|
g.puts exercise_guide(section)
end
end
end
desc "Generate HTML out of Markdown (Slides)"
task :md_to_html do
html_dir = File.join("slides", "html")
sections = showoff_sections
FileUtils.mkdir_p(html_dir)
sections.each_with_index do |s,i|
fn = File.join(html_dir, "section-#{i}-#{s}.html")
%x[grep -v "@@@" slides/#{s}/01_slide.md | redcarpet > #{fn}]
%x[cp #{s}/*.png html 2>/dev/null]
File.open(File.join("slides", "html", "index.html"), "a+") do |h|
h.puts html_list_item s, fn
end
end
end
desc "Generate HTML out of Markdown (Guides)"
task :student_guide do
html_dir = File.join("guides", "html")
guides_dir = File.join("guides", "student-exercises")
sections = showoff_sections
markdown = []
FileUtils.mkdir_p(html_dir)
sections.each do |s|
fn = File.join(guides_dir, "#{s}.md")
markdown << IO.read(fn) if File.exists?(fn)
end
File.open(File.join(html_dir, "Student-Exercises.html"), "a+") do |h|
h.puts Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(markdown.join("\n<hr />\n"))
end
end
desc "Count the number of slides per section"
task :slide_counter do
sections = showoff_sections
puts "** Number of slides in each section:"
sections.each do |section|
puts "- #{section}: #{line_count(File.join("slides", section, "01_slide.md"))}"
end
end
def line_count(slides)
count = 0
begin
f = File.open(slides)
rescue
return "section does not exist, create with `mksection`"
end
f.each do |line|
count += 1 if line =~ /^# /
end
count
end
def html_list_item(section, filename)
%Q{<li><a href="../#{filename}">#{section}</a></li>}
end
def showoff_sections
JSON.parse(IO.read(File.join("slides", "showoff.json")))['sections']
end
def section_header(section = "welcome")
lcase = %w{an of the a}
parts = section.split(/[-_]/)
header = Array(parts).flatten.map {|p| lcase.include?(p) ? p : p.capitalize }
header.join(' ')
end
def copyright_header
"\n.notes These course materials are Copyright © 2010-2012 Opscode, Inc. All rights reserved.
This work is licensed under a Creative Commons Attribution Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us; or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.\n\n"
end
def exercise_guide(section = "welcome")
"#{section_header(section)}\n======================\n\n## Objectives\n\n## Acceptance Criteria\n\n## Questions\n"
end
Oops, something went wrong.

0 comments on commit 4c1874c

Please sign in to comment.