trickster 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5308d593c057d2a323226877617ae50e6aac31ec
4
- data.tar.gz: 9b5050525dfc9eeef89352a7d73807c2b89b86a9
3
+ metadata.gz: 2cbd32e7bfd1f9179242368244df932da57a3e0f
4
+ data.tar.gz: 321ce664454f8351575baeee7fd82e1f193bdbb8
5
5
  SHA512:
6
- metadata.gz: ad51ce913a437a04c8ca3fb0bf4258601bb28dc8873b931a31321a064f520ed3dfd127ba5b01af62cc59b9698c86bd4c6c877ac1e809b09a2ce5d785afc26e3d
7
- data.tar.gz: 574787f3ae4030971b1ccebbdfae5ad0c504504427440c3ded1aac5706c5a06116394a89ce1c3f9158b16edf10dee3ea1080874b2f7341f05c17a3e496f2f5e8
6
+ metadata.gz: a5901ea211e0282e9b50a0dbd3ad54097246050b6e0d9b411ed109b070326285c963c5aeaeae5f47622154f66315689d73834c3895c8fd995d1fd01eee8cfc58
7
+ data.tar.gz: b2de674a15470b8ac4cc5098111683cc0fddaabc1952dc1d07e512425fd5eb58931baa0f033312f22c01f33e3b746a4487541e02dc14fd7ab579594ba1e8ddb4
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ Gemfile.lock
14
14
  results.html
15
15
  .rbx
16
16
  .DS_Store
17
+ test_slides.html
@@ -59,6 +59,10 @@ The first line is the url to the image to show. Trickster will size the image d
59
59
 
60
60
  If the first line starts with <tt>file://</tt>, the contents of this file is read in as the contents of the code block. Otherwise, the entire contents of the slide is verbatim put into a +pre+ and then +code+ block. Syntax highlighting is done using +highlight.js+.
61
61
 
62
+ == FREEFORM
63
+
64
+ The slide's content is passed through verbatim (keeping in mind that blank lines are slide delimiters). This allows you to do more sophisticated layouts like tables or floats.
65
+
62
66
  === Language
63
67
 
64
68
  By default, no language is specified for highlighting, so +highlight.js+ will make a guess. If you'd like to be explicit, use the +language+ option, e.g.
@@ -1,5 +1,6 @@
1
1
  require 'trickster/version'
2
2
  require 'trickster/slide_parser'
3
+ require 'trickster/renderer/freeform_renderer'
3
4
  require 'trickster/renderer/code_renderer'
4
5
  require 'trickster/renderer/bullets_renderer'
5
6
  require 'trickster/renderer/commandline_renderer'
@@ -0,0 +1,9 @@
1
+ module Trickster
2
+ module Renderer
3
+ class FreeformRenderer
4
+ def render(io,content,options)
5
+ content.each { |line| io.puts line }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -21,6 +21,7 @@ module Trickster
21
21
  hash["COMMANDLINE"] = Renderer::CommandlineRenderer.new
22
22
  hash["BULLETS"] = Renderer::BulletsRenderer.new
23
23
  hash["CODE"] = Renderer::CodeRenderer.new
24
+ hash["FREEFORM"] = Renderer::FreeformRenderer.new
24
25
  }.freeze
25
26
 
26
27
  def write_slide(slide_type,content,slide)
@@ -1,3 +1,3 @@
1
1
  module Trickster
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -85,6 +85,25 @@ class SlideRendererTest < Clean::Test::TestCase
85
85
  }
86
86
  end
87
87
 
88
+ test_that "a free-form slide just passes through the HTML" do
89
+ Given {
90
+ @html = %{<h1>This is some stuff</h1>
91
+ <table>
92
+ <thead><tr><th>Name</th><th>Age</th></tr></thead>
93
+ <tbody>
94
+ <tr><td>Bob</td><td>24</td></tr>
95
+ <tr><td>Rudy</td><td>13</td></tr>
96
+ </tbody>
97
+ </table>}
98
+ }
99
+ When {
100
+ @renderer.render_slide("FREEFORM",@html.split("\n"))
101
+ }
102
+ Then {
103
+ assert_content("FREEFORM",@html,@renderer.content)
104
+ }
105
+ end
106
+
88
107
  test_that "bullets get the first line as title, remainder as bullets, removing the bullet char" do
89
108
  Given {
90
109
  @title = any_string
@@ -43,3 +43,21 @@ drwxr-xr-x 3 David staff 102 Sep 10 17:07 tmp
43
43
  drwxr-xr-x 9 David staff 306 Sep 10 17:19 test
44
44
  > rm *
45
45
 
46
+ !FREEFORM
47
+ <h1>This is a freeform slide</h1>
48
+ <table>
49
+ <thead><tr>
50
+ <th>Name</th><th>Age</th><th>Role</th>
51
+ </tr></thead>
52
+ <tbody>
53
+ <tr>
54
+ <td>Dave</td><td>40</td><td>Husband</td>
55
+ </tr>
56
+ <tr>
57
+ <td>Amy</td><td>One shouldn't ask</td><td>Wife</td>
58
+ </tr>
59
+ <tr>
60
+ <td>Rudy</td><td>13</td><td>Cat</td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trickster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Copeland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-04 00:00:00.000000000 Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -207,6 +207,7 @@ files:
207
207
  - lib/trickster/renderer/bullets_renderer.rb
208
208
  - lib/trickster/renderer/code_renderer.rb
209
209
  - lib/trickster/renderer/commandline_renderer.rb
210
+ - lib/trickster/renderer/freeform_renderer.rb
210
211
  - lib/trickster/renderer/image_renderer.rb
211
212
  - lib/trickster/renderer/normal_renderer.rb
212
213
  - lib/trickster/slide_parser.rb