slippery 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +15 -0
  2. data/.travis.yml +27 -0
  3. data/Gemfile +10 -0
  4. data/Gemfile.devtools +59 -0
  5. data/Gemfile.lock +220 -0
  6. data/LICENSE +9 -0
  7. data/README.md +122 -0
  8. data/Rakefile +2 -0
  9. data/assets/impress.js/css/impress-demo.css +703 -0
  10. data/assets/impress.js/js/impress.js +800 -0
  11. data/assets/reveal.js/css/print/paper.css +176 -0
  12. data/assets/reveal.js/css/print/pdf.css +190 -0
  13. data/assets/reveal.js/css/reveal.css +1616 -0
  14. data/assets/reveal.js/css/reveal.min.css +7 -0
  15. data/assets/reveal.js/css/theme/README.md +23 -0
  16. data/assets/reveal.js/css/theme/beige.css +142 -0
  17. data/assets/reveal.js/css/theme/default.css +142 -0
  18. data/assets/reveal.js/css/theme/moon.css +142 -0
  19. data/assets/reveal.js/css/theme/night.css +130 -0
  20. data/assets/reveal.js/css/theme/serif.css +132 -0
  21. data/assets/reveal.js/css/theme/simple.css +132 -0
  22. data/assets/reveal.js/css/theme/sky.css +139 -0
  23. data/assets/reveal.js/css/theme/solarized.css +142 -0
  24. data/assets/reveal.js/css/theme/source/beige.scss +50 -0
  25. data/assets/reveal.js/css/theme/source/default.scss +42 -0
  26. data/assets/reveal.js/css/theme/source/moon.scss +68 -0
  27. data/assets/reveal.js/css/theme/source/night.scss +35 -0
  28. data/assets/reveal.js/css/theme/source/serif.scss +35 -0
  29. data/assets/reveal.js/css/theme/source/simple.scss +38 -0
  30. data/assets/reveal.js/css/theme/source/sky.scss +46 -0
  31. data/assets/reveal.js/css/theme/source/solarized.scss +74 -0
  32. data/assets/reveal.js/css/theme/template/mixins.scss +29 -0
  33. data/assets/reveal.js/css/theme/template/settings.scss +33 -0
  34. data/assets/reveal.js/css/theme/template/theme.scss +163 -0
  35. data/assets/reveal.js/js/head.min.js +8 -0
  36. data/assets/reveal.js/js/reveal.js +2577 -0
  37. data/assets/reveal.js/js/reveal.min.js +8 -0
  38. data/assets/reveal.js/lib/css/zenburn.css +115 -0
  39. data/assets/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
  40. data/assets/reveal.js/lib/font/league_gothic-webfont.svg +230 -0
  41. data/assets/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
  42. data/assets/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
  43. data/assets/reveal.js/lib/font/league_gothic_license +2 -0
  44. data/assets/reveal.js/lib/js/classList.js +2 -0
  45. data/assets/reveal.js/lib/js/head.min.js +8 -0
  46. data/assets/reveal.js/lib/js/html5shiv.js +7 -0
  47. data/assets/reveal.js/plugin/highlight/highlight.js +31 -0
  48. data/assets/reveal.js/plugin/leap/leap.js +154 -0
  49. data/assets/reveal.js/plugin/markdown/example.html +97 -0
  50. data/assets/reveal.js/plugin/markdown/example.md +29 -0
  51. data/assets/reveal.js/plugin/markdown/markdown.js +190 -0
  52. data/assets/reveal.js/plugin/markdown/marked.js +37 -0
  53. data/assets/reveal.js/plugin/multiplex/client.js +13 -0
  54. data/assets/reveal.js/plugin/multiplex/index.js +56 -0
  55. data/assets/reveal.js/plugin/multiplex/master.js +50 -0
  56. data/assets/reveal.js/plugin/notes/notes.html +253 -0
  57. data/assets/reveal.js/plugin/notes/notes.js +100 -0
  58. data/assets/reveal.js/plugin/notes-server/client.js +57 -0
  59. data/assets/reveal.js/plugin/notes-server/index.js +59 -0
  60. data/assets/reveal.js/plugin/notes-server/notes.html +142 -0
  61. data/assets/reveal.js/plugin/postmessage/example.html +39 -0
  62. data/assets/reveal.js/plugin/postmessage/postmessage.js +42 -0
  63. data/assets/reveal.js/plugin/print-pdf/print-pdf.js +44 -0
  64. data/assets/reveal.js/plugin/remotes/remotes.js +39 -0
  65. data/assets/reveal.js/plugin/search/search.js +196 -0
  66. data/assets/reveal.js/plugin/zoom-js/zoom.js +256 -0
  67. data/config/flay.yml +3 -0
  68. data/config/flog.yml +2 -0
  69. data/config/mutant.yml +3 -0
  70. data/config/reek.yml +108 -0
  71. data/config/rubocop.yml +71 -0
  72. data/config/yardstick.yml +2 -0
  73. data/lib/slippery/converter.rb +130 -0
  74. data/lib/slippery/document.rb +20 -0
  75. data/lib/slippery/presentation.rb +36 -0
  76. data/lib/slippery/processor_helpers.rb +43 -0
  77. data/lib/slippery/processors/add_google_font.rb +27 -0
  78. data/lib/slippery/processors/graphviz_dot.rb +46 -0
  79. data/lib/slippery/processors/hr_to_sections.rb +36 -0
  80. data/lib/slippery/processors/impress_js/add_impress_js.rb +30 -0
  81. data/lib/slippery/processors/impress_js/auto_offsets.rb +25 -0
  82. data/lib/slippery/processors/reveal_js/add_reveal_js.rb +78 -0
  83. data/lib/slippery/processors/self_contained.rb +62 -0
  84. data/lib/slippery/version.rb +3 -0
  85. data/lib/slippery.rb +42 -0
  86. data/slippery.gemspec +25 -0
  87. data/spec/fixtures/blockquotes.md +6 -0
  88. data/spec/fixtures/code_blocks.md +9 -0
  89. data/spec/fixtures/definition_lists.md +2 -0
  90. data/spec/fixtures/header_and_paragraph.md +2 -0
  91. data/spec/fixtures/headers.md +13 -0
  92. data/spec/fixtures/ordered_list.md +3 -0
  93. data/spec/fixtures/unordered_list.md +3 -0
  94. data/spec/slippery/converter_spec.rb +67 -0
  95. data/spec/slippery_spec.rb +0 -0
  96. data/spec/spec_helper.rb +20 -0
  97. metadata +208 -0
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ describe Slippery::Converter, 'convert' do
4
+ subject(:converter) { Class.new(described_class) { def blank ; end }.new }
5
+ let(:hexp) { converter.convert(document.root) }
6
+ let(:document) { Kramdown::Document.new(markdown) }
7
+ let(:markdown) { load_fixture(fixture) }
8
+
9
+ def html(*children)
10
+ H[:html, [H[:head], H[:body, children]]]
11
+ end
12
+
13
+ SPECS = {
14
+ 'header_and_paragraph' => [
15
+ H[:h1, 'Hello, World!'],
16
+ H[:p, 'This is a paragraph.']
17
+ ],
18
+ 'headers' => [
19
+ H[:h1, 'Level 1'],
20
+ H[:h2, 'Level 2'],
21
+ H[:h3, 'Level 3'],
22
+ H[:h1, 'Level 1 again'],
23
+ H[:h2, 'Level 2'],
24
+ H[:h6, 'Level 6']
25
+ ],
26
+ 'blockquotes' => [
27
+ H[:blockquote, [
28
+ H[:p, 'This is a block quote'],
29
+ H[:p, 'With two paragraphs']
30
+ ]],
31
+ H[:blockquote, [
32
+ H[:p, "This is a second block quote\nthat is hand-wrapped"]
33
+ ]]
34
+ ],
35
+ 'code_blocks' => [
36
+ H[:pre, [H[:code, ["an indented code block\n"]]]],
37
+ H[:pre, [H[:code, ["a fenced code block\n"]]]],
38
+ H[:pre, { 'class' => 'language-ruby' }, [H[:code,
39
+ ["code block with language specifier\n"]]]]
40
+ ],
41
+ 'unordered_list' => [
42
+ H[:ul, [
43
+ H[:li, [H[:p, 'banana']]],
44
+ H[:li, [H[:p, 'apple']]],
45
+ H[:li, [H[:p, 'guava']]]]]
46
+ ],
47
+ 'ordered_list' => [
48
+ H[:ol, [
49
+ H[:li, [H[:p, 'ninjas']]],
50
+ H[:li, [H[:p, 'pirates']]],
51
+ H[:li, [H[:p, 'sales people']]]]]
52
+ ],
53
+ 'definition_lists' => [
54
+ H[:dl, [
55
+ H[:dt, ['Jabberwocky']],
56
+ H[:dd, [H[:p, 'mythical beast of poetic proportions']]]]]
57
+ ]
58
+ }
59
+
60
+ SPECS.each do |fixture_name, result|
61
+ context fixture_name do
62
+ let(:fixture) { fixture_name }
63
+ specify { expect(hexp).to eq html(*result) }
64
+ end
65
+ end
66
+
67
+ end
File without changes
@@ -0,0 +1,20 @@
1
+ require 'slippery'
2
+ require 'devtools/spec_helper'
3
+
4
+ # Helper to load markdown files under spec/fixtures
5
+ #
6
+ module FixtureLoader
7
+ # Given its base name, load the Markdown file from spec/fixtures/#{name}.md
8
+ #
9
+ # @param name [String] The short name
10
+ # @return [String]
11
+ # @api private
12
+ #
13
+ def load_fixture(name)
14
+ IO.read(File.expand_path(File.join('../fixtures', name) + '.md', __FILE__))
15
+ end
16
+ end
17
+
18
+ RSpec.configure do |config|
19
+ config.include(FixtureLoader)
20
+ end
metadata ADDED
@@ -0,0 +1,208 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slippery
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Arne Brasseur
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '0.0'
19
+ prerelease: false
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '0.0'
25
+ name: hexp
26
+ type: :runtime
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '1.1'
33
+ prerelease: false
34
+ version_requirements: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '1.1'
39
+ name: kramdown
40
+ type: :runtime
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '10.1'
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: '10.1'
53
+ name: rake
54
+ type: :development
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: '2.14'
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: '2.14'
67
+ name: rspec
68
+ type: :development
69
+ description: Make presentations with Markdown
70
+ email:
71
+ - arne@arnebrasseur.net
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files:
75
+ - README.md
76
+ - LICENSE
77
+ files:
78
+ - .travis.yml
79
+ - Gemfile
80
+ - Gemfile.devtools
81
+ - Gemfile.lock
82
+ - LICENSE
83
+ - README.md
84
+ - Rakefile
85
+ - assets/impress.js/css/impress-demo.css
86
+ - assets/impress.js/js/impress.js
87
+ - assets/reveal.js/css/print/paper.css
88
+ - assets/reveal.js/css/print/pdf.css
89
+ - assets/reveal.js/css/reveal.css
90
+ - assets/reveal.js/css/reveal.min.css
91
+ - assets/reveal.js/css/theme/README.md
92
+ - assets/reveal.js/css/theme/beige.css
93
+ - assets/reveal.js/css/theme/default.css
94
+ - assets/reveal.js/css/theme/moon.css
95
+ - assets/reveal.js/css/theme/night.css
96
+ - assets/reveal.js/css/theme/serif.css
97
+ - assets/reveal.js/css/theme/simple.css
98
+ - assets/reveal.js/css/theme/sky.css
99
+ - assets/reveal.js/css/theme/solarized.css
100
+ - assets/reveal.js/css/theme/source/beige.scss
101
+ - assets/reveal.js/css/theme/source/default.scss
102
+ - assets/reveal.js/css/theme/source/moon.scss
103
+ - assets/reveal.js/css/theme/source/night.scss
104
+ - assets/reveal.js/css/theme/source/serif.scss
105
+ - assets/reveal.js/css/theme/source/simple.scss
106
+ - assets/reveal.js/css/theme/source/sky.scss
107
+ - assets/reveal.js/css/theme/source/solarized.scss
108
+ - assets/reveal.js/css/theme/template/mixins.scss
109
+ - assets/reveal.js/css/theme/template/settings.scss
110
+ - assets/reveal.js/css/theme/template/theme.scss
111
+ - assets/reveal.js/js/head.min.js
112
+ - assets/reveal.js/js/reveal.js
113
+ - assets/reveal.js/js/reveal.min.js
114
+ - assets/reveal.js/lib/css/zenburn.css
115
+ - assets/reveal.js/lib/font/league_gothic-webfont.eot
116
+ - assets/reveal.js/lib/font/league_gothic-webfont.svg
117
+ - assets/reveal.js/lib/font/league_gothic-webfont.ttf
118
+ - assets/reveal.js/lib/font/league_gothic-webfont.woff
119
+ - assets/reveal.js/lib/font/league_gothic_license
120
+ - assets/reveal.js/lib/js/classList.js
121
+ - assets/reveal.js/lib/js/head.min.js
122
+ - assets/reveal.js/lib/js/html5shiv.js
123
+ - assets/reveal.js/plugin/highlight/highlight.js
124
+ - assets/reveal.js/plugin/leap/leap.js
125
+ - assets/reveal.js/plugin/markdown/example.html
126
+ - assets/reveal.js/plugin/markdown/example.md
127
+ - assets/reveal.js/plugin/markdown/markdown.js
128
+ - assets/reveal.js/plugin/markdown/marked.js
129
+ - assets/reveal.js/plugin/multiplex/client.js
130
+ - assets/reveal.js/plugin/multiplex/index.js
131
+ - assets/reveal.js/plugin/multiplex/master.js
132
+ - assets/reveal.js/plugin/notes-server/client.js
133
+ - assets/reveal.js/plugin/notes-server/index.js
134
+ - assets/reveal.js/plugin/notes-server/notes.html
135
+ - assets/reveal.js/plugin/notes/notes.html
136
+ - assets/reveal.js/plugin/notes/notes.js
137
+ - assets/reveal.js/plugin/postmessage/example.html
138
+ - assets/reveal.js/plugin/postmessage/postmessage.js
139
+ - assets/reveal.js/plugin/print-pdf/print-pdf.js
140
+ - assets/reveal.js/plugin/remotes/remotes.js
141
+ - assets/reveal.js/plugin/search/search.js
142
+ - assets/reveal.js/plugin/zoom-js/zoom.js
143
+ - config/flay.yml
144
+ - config/flog.yml
145
+ - config/mutant.yml
146
+ - config/reek.yml
147
+ - config/rubocop.yml
148
+ - config/yardstick.yml
149
+ - lib/slippery.rb
150
+ - lib/slippery/converter.rb
151
+ - lib/slippery/document.rb
152
+ - lib/slippery/presentation.rb
153
+ - lib/slippery/processor_helpers.rb
154
+ - lib/slippery/processors/add_google_font.rb
155
+ - lib/slippery/processors/graphviz_dot.rb
156
+ - lib/slippery/processors/hr_to_sections.rb
157
+ - lib/slippery/processors/impress_js/add_impress_js.rb
158
+ - lib/slippery/processors/impress_js/auto_offsets.rb
159
+ - lib/slippery/processors/reveal_js/add_reveal_js.rb
160
+ - lib/slippery/processors/self_contained.rb
161
+ - lib/slippery/version.rb
162
+ - slippery.gemspec
163
+ - spec/fixtures/blockquotes.md
164
+ - spec/fixtures/code_blocks.md
165
+ - spec/fixtures/definition_lists.md
166
+ - spec/fixtures/header_and_paragraph.md
167
+ - spec/fixtures/headers.md
168
+ - spec/fixtures/ordered_list.md
169
+ - spec/fixtures/unordered_list.md
170
+ - spec/slippery/converter_spec.rb
171
+ - spec/slippery_spec.rb
172
+ - spec/spec_helper.rb
173
+ homepage: https://github.com/plexus/slippery
174
+ licenses:
175
+ - MIT
176
+ metadata: {}
177
+ post_install_message:
178
+ rdoc_options: []
179
+ require_paths:
180
+ - lib
181
+ required_ruby_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ! '>='
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ required_rubygems_version: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ requirements: []
192
+ rubyforge_project:
193
+ rubygems_version: 2.1.10
194
+ signing_key:
195
+ specification_version: 4
196
+ summary: Make presentations with Markdown
197
+ test_files:
198
+ - spec/fixtures/blockquotes.md
199
+ - spec/fixtures/code_blocks.md
200
+ - spec/fixtures/definition_lists.md
201
+ - spec/fixtures/header_and_paragraph.md
202
+ - spec/fixtures/headers.md
203
+ - spec/fixtures/ordered_list.md
204
+ - spec/fixtures/unordered_list.md
205
+ - spec/slippery/converter_spec.rb
206
+ - spec/slippery_spec.rb
207
+ - spec/spec_helper.rb
208
+ has_rdoc: