slide_hero 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/Guardfile +28 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +161 -0
  8. data/Rakefile +9 -0
  9. data/bin/slidehero +37 -0
  10. data/config.ru +14 -0
  11. data/lib/slide_hero/code.rb +16 -0
  12. data/lib/slide_hero/dsl.rb +10 -0
  13. data/lib/slide_hero/grouped_slides.rb +21 -0
  14. data/lib/slide_hero/list.rb +29 -0
  15. data/lib/slide_hero/list_point.rb +26 -0
  16. data/lib/slide_hero/point.rb +27 -0
  17. data/lib/slide_hero/presentation.rb +36 -0
  18. data/lib/slide_hero/slide.rb +47 -0
  19. data/lib/slide_hero/version.rb +3 -0
  20. data/lib/slide_hero/views/_footer.html.erb +0 -0
  21. data/lib/slide_hero/views/_header.html.erb +0 -0
  22. data/lib/slide_hero/views/code.html.erb +3 -0
  23. data/lib/slide_hero/views/empty.html +12 -0
  24. data/lib/slide_hero/views/grouped_slides.html.erb +5 -0
  25. data/lib/slide_hero/views/layout.html.erb +54 -0
  26. data/lib/slide_hero/views/ordered_list.html.erb +5 -0
  27. data/lib/slide_hero/views/slide.html.erb +6 -0
  28. data/lib/slide_hero/views/unordered_list.html.erb +5 -0
  29. data/lib/slide_hero.rb +15 -0
  30. data/slide_hero.gemspec +29 -0
  31. data/templates/new_presentation.tt +11 -0
  32. data/test/fixtures/testclass.rb +5 -0
  33. data/test/minitest_helper.rb +18 -0
  34. data/test/slide_hero/code_spec.rb +29 -0
  35. data/test/slide_hero/dsl_spec.rb +27 -0
  36. data/test/slide_hero/grouped_slides_spec.rb +29 -0
  37. data/test/slide_hero/list_point_spec.rb +34 -0
  38. data/test/slide_hero/list_spec.rb +49 -0
  39. data/test/slide_hero/point_spec.rb +25 -0
  40. data/test/slide_hero/presentation_spec.rb +56 -0
  41. data/test/slide_hero/slide_spec.rb +147 -0
  42. data/test/slide_hero_spec.rb +15 -0
  43. data/vendor/reveal.js/.gitignore +6 -0
  44. data/vendor/reveal.js/.travis.yml +5 -0
  45. data/vendor/reveal.js/Gruntfile.js +132 -0
  46. data/vendor/reveal.js/LICENSE +19 -0
  47. data/vendor/reveal.js/README.md +798 -0
  48. data/vendor/reveal.js/css/print/paper.css +176 -0
  49. data/vendor/reveal.js/css/print/pdf.css +190 -0
  50. data/vendor/reveal.js/css/reveal.css +1649 -0
  51. data/vendor/reveal.js/css/reveal.min.css +7 -0
  52. data/vendor/reveal.js/css/theme/README.md +23 -0
  53. data/vendor/reveal.js/css/theme/beige.css +142 -0
  54. data/vendor/reveal.js/css/theme/default.css +142 -0
  55. data/vendor/reveal.js/css/theme/moon.css +142 -0
  56. data/vendor/reveal.js/css/theme/night.css +130 -0
  57. data/vendor/reveal.js/css/theme/serif.css +132 -0
  58. data/vendor/reveal.js/css/theme/simple.css +132 -0
  59. data/vendor/reveal.js/css/theme/sky.css +139 -0
  60. data/vendor/reveal.js/css/theme/solarized.css +142 -0
  61. data/vendor/reveal.js/css/theme/source/beige.scss +50 -0
  62. data/vendor/reveal.js/css/theme/source/default.scss +42 -0
  63. data/vendor/reveal.js/css/theme/source/moon.scss +68 -0
  64. data/vendor/reveal.js/css/theme/source/night.scss +35 -0
  65. data/vendor/reveal.js/css/theme/source/serif.scss +35 -0
  66. data/vendor/reveal.js/css/theme/source/simple.scss +38 -0
  67. data/vendor/reveal.js/css/theme/source/sky.scss +46 -0
  68. data/vendor/reveal.js/css/theme/source/solarized.scss +74 -0
  69. data/vendor/reveal.js/css/theme/template/mixins.scss +29 -0
  70. data/vendor/reveal.js/css/theme/template/settings.scss +34 -0
  71. data/vendor/reveal.js/css/theme/template/theme.scss +163 -0
  72. data/vendor/reveal.js/examples/assets/image1.png +0 -0
  73. data/vendor/reveal.js/examples/assets/image2.png +0 -0
  74. data/vendor/reveal.js/examples/barebones.html +42 -0
  75. data/vendor/reveal.js/examples/embedded-media.html +49 -0
  76. data/vendor/reveal.js/examples/math.html +185 -0
  77. data/vendor/reveal.js/examples/slide-backgrounds.html +101 -0
  78. data/vendor/reveal.js/js/reveal.js +2788 -0
  79. data/vendor/reveal.js/js/reveal.min.js +8 -0
  80. data/vendor/reveal.js/lib/css/zenburn.css +115 -0
  81. data/vendor/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
  82. data/vendor/reveal.js/lib/font/league_gothic-webfont.svg +230 -0
  83. data/vendor/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
  84. data/vendor/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
  85. data/vendor/reveal.js/lib/font/league_gothic_license +2 -0
  86. data/vendor/reveal.js/lib/js/classList.js +2 -0
  87. data/vendor/reveal.js/lib/js/head.min.js +8 -0
  88. data/vendor/reveal.js/lib/js/html5shiv.js +7 -0
  89. data/vendor/reveal.js/package.json +45 -0
  90. data/vendor/reveal.js/plugin/highlight/highlight.js +31 -0
  91. data/vendor/reveal.js/plugin/leap/leap.js +157 -0
  92. data/vendor/reveal.js/plugin/markdown/example.html +98 -0
  93. data/vendor/reveal.js/plugin/markdown/example.md +31 -0
  94. data/vendor/reveal.js/plugin/markdown/markdown.js +220 -0
  95. data/vendor/reveal.js/plugin/markdown/marked.js +37 -0
  96. data/vendor/reveal.js/plugin/math/math.js +64 -0
  97. data/vendor/reveal.js/plugin/multiplex/client.js +13 -0
  98. data/vendor/reveal.js/plugin/multiplex/index.js +56 -0
  99. data/vendor/reveal.js/plugin/multiplex/master.js +50 -0
  100. data/vendor/reveal.js/plugin/notes/notes.html +259 -0
  101. data/vendor/reveal.js/plugin/notes/notes.js +78 -0
  102. data/vendor/reveal.js/plugin/notes-server/client.js +57 -0
  103. data/vendor/reveal.js/plugin/notes-server/index.js +59 -0
  104. data/vendor/reveal.js/plugin/notes-server/notes.html +142 -0
  105. data/vendor/reveal.js/plugin/postmessage/example.html +39 -0
  106. data/vendor/reveal.js/plugin/postmessage/postmessage.js +42 -0
  107. data/vendor/reveal.js/plugin/print-pdf/print-pdf.js +44 -0
  108. data/vendor/reveal.js/plugin/remotes/remotes.js +39 -0
  109. data/vendor/reveal.js/plugin/search/search.js +196 -0
  110. data/vendor/reveal.js/plugin/zoom-js/zoom.js +256 -0
  111. metadata +277 -0
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'slide_hero/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "slide_hero"
8
+ spec.version = SlideHero::VERSION
9
+ spec.authors = ["Steven Nunez"]
10
+ spec.email = ["steven.nunez@gmail.com"]
11
+ spec.description = %q{Used for creating slide decks backed by reveal.js}
12
+ spec.summary = %q{Used for creating slide decks backed by reveal.js}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "tilt", "~> 1.4.1"
22
+ spec.add_dependency "thor", "~> 0.18.1"
23
+ spec.add_dependency "rack", "~> 1.5.2"
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "minitest"
27
+ spec.add_development_dependency "guard"
28
+ spec.add_development_dependency "guard-minitest"
29
+ end
@@ -0,0 +1,11 @@
1
+ require 'slide_hero'
2
+
3
+ presentation '<%= @name %>' do
4
+ slide "Presentations made easy!" do
5
+ point "Make presentations at the speed of thought"
6
+ point "Make ideas pop", animation: "grow"
7
+ list do
8
+ point "All kinds of awesome here"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class Working
2
+ def some_method
3
+ "woot!"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'slide_hero'
3
+
4
+ require 'minitest/autorun'
5
+ require 'minitest/spec'
6
+ def assert_dom_match(expected, actual)
7
+ dom_clean(actual).must_equal(
8
+ dom_clean(expected))
9
+ end
10
+
11
+ def assert_dom_includes(expected, actual)
12
+ dom_clean(actual).must_include(
13
+ dom_clean(expected))
14
+ end
15
+
16
+ def dom_clean(html)
17
+ html.gsub!(/>\s*</, '><').strip
18
+ end
@@ -0,0 +1,29 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe Code do
5
+ it "formats code properly" do
6
+ code = Code.new(:ruby) do
7
+ "test/fixtures/testclass.rb"
8
+ end
9
+
10
+ code.compile.strip.must_equal '<pre><code data-trim>
11
+ class Working
12
+ def some_method
13
+ "woot!"
14
+ end
15
+ end
16
+
17
+ </code></pre>'
18
+ end
19
+
20
+ it "exits if file is not found" do
21
+
22
+ lambda do
23
+ code = Code.new(:ruby) do
24
+ "dont_exists.rb"
25
+ end
26
+ end.must_raise SystemExit
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,27 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe DSL do
5
+ include SlideHero::DSL
6
+ it "creates a presentation object at root object" do
7
+ pres = presentation "I like turtles" do
8
+ slide "Turtles are cool" do
9
+ point "Not as cool as fezzes"
10
+ end
11
+ end
12
+ pres.must_include "Turtles are cool"
13
+ end
14
+
15
+ it "passes code properly" do
16
+ pres = presentation "Code" do
17
+ slide "Code test" do
18
+ code(:ruby) do
19
+ "test/fixtures/testclass.rb"
20
+ end
21
+ end
22
+ end
23
+
24
+ pres.must_include "class Working"
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,29 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe GroupedSlides do
5
+ describe "nesting slides" do
6
+ it "groups sections" do
7
+ grouped_slides = GroupedSlides.new do
8
+ slide "banana" do
9
+ point "High in potassium"
10
+ end
11
+ slide "apple" do
12
+ point "Good if you hate doctors"
13
+ end
14
+ end
15
+
16
+ assert_dom_match grouped_slides.compile, "<section>" +
17
+ "<section data-transition=\"default\">" +
18
+ "<h1>banana</h1>" +
19
+ "<p>High in potassium</p>" +
20
+ "</section>" +
21
+ "<section data-transition=\"default\">" +
22
+ "<h1>apple</h1>" +
23
+ "<p>Good if you hate doctors</p>" +
24
+ "</section>" +
25
+ "</section>"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe ListPoint do
5
+ it "takes text and an animation on initialization" do
6
+ list_point = ListPoint.new("point!", animation: nil)
7
+ list_point.text.must_equal "point!"
8
+ list_point.animation.must_equal nil
9
+ list_point.animation_class.must_equal nil
10
+ end
11
+
12
+ describe "#animation_class" do
13
+ it "applies fragement if animation is true" do
14
+ list_point = ListPoint.new("foo", animation: true)
15
+ list_point.animation_class.must_equal " class=\"fragment \""
16
+ end
17
+
18
+ it "only applies simple animation if value not supported" do
19
+ list_point = ListPoint.new("foo", animation: "banana")
20
+ list_point.animation_class.must_equal " class=\"fragment \""
21
+ end
22
+
23
+ it "applies extra classes for supported animations" do
24
+ supported_animations = %w{grow shrink roll-in fade-out
25
+ highlight-red highlight-green highlight-blue}
26
+
27
+ supported_animations.each do |animation|
28
+ list_point = ListPoint.new("foo", animation: animation)
29
+ list_point.animation_class.must_equal " class=\"fragment #{animation}\""
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,49 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe List do
5
+ it "takes a block of items to list" do
6
+ list = List.new do
7
+ point "A thing"
8
+ point "another"
9
+ end
10
+
11
+ assert_dom_match(list.compile, '<ul><li>A thing</li><li>another</li></ul>')
12
+ end
13
+
14
+ it "returns an ordered list" do
15
+ list = List.new(:ordered) do
16
+ point "A thing"
17
+ point "another"
18
+ end
19
+
20
+ assert_dom_match(list.compile, '<ol><li>A thing</li><li>another</li></ol>')
21
+ end
22
+
23
+ it "supports animations" do
24
+ list = List.new do
25
+ point "animated!", animation: true
26
+ end
27
+ assert_dom_match(list.compile, '<ul>' +
28
+ '<li class="fragment ">' +
29
+ 'animated!' +
30
+ '</li>' +
31
+ '</ul>')
32
+ end
33
+
34
+ it "supports specific animations" do
35
+ supported_animations = %w{grow shrink roll-in fade-out
36
+ highlight-red highlight-green highlight-blue}
37
+ supported_animations.each do |animation|
38
+ list = List.new do
39
+ point "all the animations!", animation: animation
40
+ end
41
+ assert_dom_match list.compile, '<ul>' +
42
+ "<li class=\"fragment #{animation}\">" +
43
+ 'all the animations!' +
44
+ '</li>' +
45
+ '</ul>'
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,25 @@
1
+ require 'minitest_helper'
2
+ module SlideHero
3
+ describe Point do
4
+ it "wraps it's text in p tags" do
5
+ point = Point.new("I'm a tiger")
6
+ point.compile.must_equal "<p>I'm a tiger</p>"
7
+ end
8
+
9
+ it "supports animations" do
10
+ point = Point.new("Animation", animation: true)
11
+ point.compile.must_equal '<p class="fragment ">Animation</p>'
12
+ end
13
+
14
+ it "supports specific animations" do
15
+ supported_animations = %w{grow shrink roll-in fade-out
16
+ highlight-red highlight-green highlight-blue}
17
+ supported_animations.each do |animation|
18
+ point = Point.new("Animation", animation: animation)
19
+ point.compile.must_equal "<p class=\"fragment #{animation}\">" +
20
+ "Animation" +
21
+ "</p>"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,56 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe Presentation do
5
+ it "takes a title" do
6
+ pres = Presentation.new("Grow gills in 8 days") do
7
+ end
8
+ pres.title.must_equal "Grow gills in 8 days"
9
+ pres.compile.must_include "<title>Grow gills in 8 days</title>"
10
+ end
11
+
12
+ it "compiles to an empty entire presentation" do
13
+ pres = Presentation.new("My Pres") {}
14
+ pres.compile.must_include "<div class=\"slides\">"
15
+ end
16
+
17
+ it "takes slides" do
18
+ pres = Presentation.new("slides") do
19
+ slide "My slide" do
20
+ point "Bananas are tastey"
21
+ end
22
+ end
23
+ pres.slides.count.must_equal 1
24
+ end
25
+
26
+ it "takes all of slide's options" do
27
+ pres = Presentation.new("slides") do
28
+ slide("My slide", headline_size: :small, transition: :default) do
29
+ point "Bananas are tastey"
30
+ end
31
+ end
32
+ pres.slides.count.must_equal 1
33
+ end
34
+
35
+ it "takes grouped_slides" do
36
+ pres = Presentation.new("slides") do
37
+ grouped_slides do
38
+ slide "My slide" do
39
+ point "Bananas are tastey"
40
+ end
41
+ end
42
+ end
43
+ pres.slides.count.must_equal 1
44
+ end
45
+
46
+ it "nests slides in presentation" do
47
+ pres = Presentation.new("New stuff") do
48
+ slide "Nesting!" do
49
+ point "Woot!"
50
+ end
51
+ end
52
+
53
+ assert_dom_includes("<section data-transition=\"default\"><h1>Nesting!</h1><p>Woot!</p></section>", pres.compile)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,147 @@
1
+ require 'minitest_helper'
2
+
3
+ module SlideHero
4
+ describe Slide do
5
+ describe "initialization" do
6
+ it "is initialized with a title" do
7
+ slide = Slide.new("Badgers learn knitting")
8
+ slide.headline.must_equal "Badgers learn knitting"
9
+ end
10
+
11
+ it "can take an optional side directive" do
12
+ slide = Slide.new("Badgers learn knitting", headline_size: :large)
13
+ slide.headline_size.must_equal :large
14
+
15
+ slide = Slide.new("Snacks lead to revolution in food care", headline_size: :medium)
16
+ slide.headline_size.must_equal :medium
17
+ end
18
+ end
19
+
20
+ describe "compilation" do
21
+ it "outputs object to html" do
22
+ slide = Slide.new("To Markup!")
23
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
24
+ "<h1>To Markup!</h1> " +
25
+ "</section>"
26
+ end
27
+
28
+ it "respects headline size" do
29
+ slide = Slide.new("To Markup!", headline_size: :medium)
30
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
31
+ "<h2>To Markup!</h2>" +
32
+ "</section>"
33
+ end
34
+
35
+ it "takes transitions" do
36
+ slide = Slide.new("transitions", transition: :zoom) do
37
+ end
38
+ assert_dom_match slide.compile, '<section data-transition="zoom">' +
39
+ '<h1>transitions</h1>' +
40
+ '</section>'
41
+ end
42
+ end
43
+
44
+ describe "#point syntax" do
45
+ it "embeds text in p tags by default" do
46
+ slide = Slide.new "Embedding" do
47
+ point "I'm embedded!"
48
+ end
49
+
50
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
51
+ "<h1>Embedding</h1>" +
52
+ "<p>I'm embedded!</p>" +
53
+ "</section>"
54
+ end
55
+
56
+ it "embeds raw html" do
57
+ slide = Slide.new "Embedding" do
58
+ point "<small>I'm embedded!</small>"
59
+ end
60
+
61
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
62
+ "<h1>Embedding</h1>" +
63
+ "<p><small>I'm embedded!</small></p>" +
64
+ "</section>"
65
+ end
66
+
67
+ it "embeds multiple points" do
68
+ slide = Slide.new "Embedding" do
69
+ point "I'm embedded!"
70
+ point "Me too!"
71
+ end
72
+
73
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
74
+ "<h1>Embedding</h1>" +
75
+ "<p>I'm embedded!</p>" +
76
+ "<p>Me too!</p>" +
77
+ "</section>"
78
+ end
79
+
80
+ it "animates points" do
81
+ slide = Slide.new "Animation" do
82
+ point "I'm animated!", animation: true
83
+ end
84
+
85
+ assert_dom_match slide.compile, "<section data-transition=\"default\">"+
86
+ "<h1>Animation</h1>" +
87
+ "<p>I'm animated!</p>" +
88
+ "</section>"
89
+
90
+ end
91
+ end
92
+
93
+ describe "#list" do
94
+ it "creates bullets from a block" do
95
+ slide = Slide.new "Lists" do
96
+ list do
97
+ point "Bullet Points"
98
+ point "Another Point"
99
+ end
100
+ end
101
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
102
+ "<h1>Lists</h1>" +
103
+ "<ul>" +
104
+ "<li>Bullet Points</li>" +
105
+ "<li>Another Point</li>" +
106
+ "</ul>" +
107
+ "</section>"
108
+ end
109
+
110
+ it "creates ordered lists from a block" do
111
+ slide = Slide.new "Lists" do
112
+ list(:ordered) do
113
+ point "Ordered!"
114
+ point "Also ordered!"
115
+ end
116
+ end
117
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
118
+ "<h1>Lists</h1>" +
119
+ "<ol>" +
120
+ "<li>Ordered!</li>" +
121
+ "<li>Also ordered!</li>" +
122
+ "</ol>" +
123
+ "</section>"
124
+ end
125
+ end
126
+ describe "#code" do
127
+ it "embeds code in a slide" do
128
+ slide = Slide.new "Code" do
129
+ code(:ruby) do
130
+ "test/fixtures/testclass.rb"
131
+ end
132
+ end
133
+
134
+ assert_dom_match slide.compile, "<section data-transition=\"default\">" +
135
+ "<h1>Code</h1>" +
136
+ "<pre><code data-trim>
137
+ class Working
138
+ def some_method
139
+ \"woot!\"
140
+ end
141
+ end
142
+
143
+ </code></pre></section>"
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,15 @@
1
+ require 'minitest_helper'
2
+ require_relative 'slide_hero/slide_spec'
3
+ require_relative 'slide_hero/point_spec'
4
+ require_relative 'slide_hero/list_spec'
5
+ require_relative 'slide_hero/list_point_spec'
6
+ require_relative 'slide_hero/grouped_slides_spec'
7
+ require_relative 'slide_hero/code_spec'
8
+ require_relative 'slide_hero/presentation_spec'
9
+ require_relative 'slide_hero/dsl_spec'
10
+
11
+ describe ::SlideHero do
12
+ it "has a version" do
13
+ ::SlideHero::VERSION.wont_be_nil
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ .DS_Store
2
+ .svn
3
+ log/*.log
4
+ tmp/**
5
+ node_modules/
6
+ .sass-cache
@@ -0,0 +1,5 @@
1
+ language: node_js
2
+ node_js:
3
+ - 0.8
4
+ before_script:
5
+ - npm install -g grunt-cli
@@ -0,0 +1,132 @@
1
+ /* global module:false */
2
+ module.exports = function(grunt) {
3
+
4
+ // Project configuration
5
+ grunt.initConfig({
6
+ pkg: grunt.file.readJSON('package.json'),
7
+ meta: {
8
+ banner:
9
+ '/*!\n' +
10
+ ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
11
+ ' * http://lab.hakim.se/reveal-js\n' +
12
+ ' * MIT licensed\n' +
13
+ ' *\n' +
14
+ ' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
15
+ ' */'
16
+ },
17
+
18
+ // Tests will be added soon
19
+ qunit: {
20
+ files: [ 'test/**/*.html' ]
21
+ },
22
+
23
+ uglify: {
24
+ options: {
25
+ banner: '<%= meta.banner %>\n'
26
+ },
27
+ build: {
28
+ src: 'js/reveal.js',
29
+ dest: 'js/reveal.min.js'
30
+ }
31
+ },
32
+
33
+ cssmin: {
34
+ compress: {
35
+ files: {
36
+ 'css/reveal.min.css': [ 'css/reveal.css' ]
37
+ }
38
+ }
39
+ },
40
+
41
+ sass: {
42
+ main: {
43
+ files: {
44
+ 'css/theme/default.css': 'css/theme/source/default.scss',
45
+ 'css/theme/beige.css': 'css/theme/source/beige.scss',
46
+ 'css/theme/night.css': 'css/theme/source/night.scss',
47
+ 'css/theme/serif.css': 'css/theme/source/serif.scss',
48
+ 'css/theme/simple.css': 'css/theme/source/simple.scss',
49
+ 'css/theme/sky.css': 'css/theme/source/sky.scss',
50
+ 'css/theme/moon.css': 'css/theme/source/moon.scss',
51
+ 'css/theme/solarized.css': 'css/theme/source/solarized.scss'
52
+ }
53
+ }
54
+ },
55
+
56
+ jshint: {
57
+ options: {
58
+ curly: false,
59
+ eqeqeq: true,
60
+ immed: true,
61
+ latedef: true,
62
+ newcap: true,
63
+ noarg: true,
64
+ sub: true,
65
+ undef: true,
66
+ eqnull: true,
67
+ browser: true,
68
+ expr: true,
69
+ globals: {
70
+ head: false,
71
+ module: false,
72
+ console: false
73
+ }
74
+ },
75
+ files: [ 'Gruntfile.js', 'js/reveal.js' ]
76
+ },
77
+
78
+ connect: {
79
+ server: {
80
+ options: {
81
+ port: 8000,
82
+ base: '.'
83
+ }
84
+ }
85
+ },
86
+
87
+ zip: {
88
+ 'reveal-js-presentation.zip': [
89
+ 'index.html',
90
+ 'css/**',
91
+ 'js/**',
92
+ 'lib/**',
93
+ 'images/**',
94
+ 'plugin/**'
95
+ ]
96
+ },
97
+
98
+ watch: {
99
+ main: {
100
+ files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
101
+ tasks: 'default'
102
+ },
103
+ theme: {
104
+ files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
105
+ tasks: 'themes'
106
+ }
107
+ }
108
+
109
+ });
110
+
111
+ // Dependencies
112
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
113
+ grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
114
+ grunt.loadNpmTasks( 'grunt-contrib-uglify' );
115
+ grunt.loadNpmTasks( 'grunt-contrib-watch' );
116
+ grunt.loadNpmTasks( 'grunt-contrib-sass' );
117
+ grunt.loadNpmTasks( 'grunt-contrib-connect' );
118
+ grunt.loadNpmTasks( 'grunt-zip' );
119
+
120
+ // Default task
121
+ grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
122
+
123
+ // Theme task
124
+ grunt.registerTask( 'themes', [ 'sass' ] );
125
+
126
+ // Package presentation to archive
127
+ grunt.registerTask( 'package', [ 'default', 'zip' ] );
128
+
129
+ // Serve presentation locally
130
+ grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
131
+
132
+ };
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2013 Hakim El Hattab, http://hakim.se
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.