mastalk 0.3.4 → 0.3.5

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: 53bd3ebc0b27533aa4bae0ecc7d05b0cf77b3e9d
4
- data.tar.gz: a0090eef7e49d3a51e25e663f06ad3b52ae78bb0
3
+ metadata.gz: e34ab5804d40bf3035fb0443125facc8de97eeb2
4
+ data.tar.gz: 70d8d346885296ce978fb0bd9fb077bf05fceb2f
5
5
  SHA512:
6
- metadata.gz: 9b09169c148db98a2e339e84506db19c5ef72dcbd7a981662374fe05c5175b0e8d619fda45ef98ecea61787bf0180a4c3ef99d7fcdc94474ff871610d4d01a64
7
- data.tar.gz: e186402c449c09b7d120c4d0a4069a09a1c1b3c8c9dea2fdb5bf0d4ec5df8ff2e32b5c6a13e7b646db2c0f90276d27e46c1d044672d503f01775e7c27a5ad9d4
6
+ metadata.gz: f648183d1ace8ec21c2ee075333a66b3d6973cb1e42aa8044fff9e07188057e616464e67978be5c08f36ce05c1b5caa1cdde6385056ef9fe968c89428a070e20
7
+ data.tar.gz: 823191b5e008407f96708d67b8ed426fba47137ac3770feed5b9ce507a3a24c776f1e135fbbdfc890a3efe7c03ebefff3c7db55dad1ba7dbe8473ef5af68cda6
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ mastalk
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.2
data/README.md CHANGED
@@ -213,3 +213,38 @@ Outputs:
213
213
  ```
214
214
  <br />
215
215
  ```
216
+
217
+ ### Block
218
+
219
+ Creates a simple two column layout with content `$bl_c` on one side and `$bl_m` opposite.
220
+
221
+ * `$bl_c` is intended to contain content of any type.
222
+ * `$bl_m` is intended to contain images, i.e. `![Alt text](img.gif)`, or video, i.e. `({5n1nixLSrQI})` or `(@3739688349001@)`.
223
+
224
+
225
+ ```
226
+ $bl
227
+
228
+ $bl_c
229
+
230
+ $bl_c
231
+
232
+ $bl_m
233
+
234
+ $bl_m
235
+
236
+ bl$
237
+ ```
238
+
239
+ Outputs:
240
+
241
+ ```
242
+ <div class="l-block">
243
+ <div class="l-block__content">
244
+ <div class="panel panel--block"></div>
245
+ </div>
246
+ <div class="l-block__media"></div>
247
+ </div>
248
+ ```
249
+
250
+ `$bl_c` `$bl_m` positioning can be swapped around to switch element positions.
@@ -9,7 +9,7 @@ module Mastalk
9
9
  #
10
10
  # <p>replacement html <%= body %></p>
11
11
  module Extensions
12
- SNIPPETS_FOLDER=File.join(File.dirname(__FILE__), 'snippets')
12
+ SNIPPETS_FOLDER = File.join(File.dirname(__FILE__), 'snippets')
13
13
  @@extensions = []
14
14
 
15
15
  def extension(start, stop = nil, &block)
@@ -0,0 +1,5 @@
1
+ # $bl, bl$
2
+
3
+ <div class="l-block">
4
+ <%= Mastalk::Document.new(body.strip).to_html.gsub(/<p>|<\/p>|\n/, '') %>
5
+ </div>
@@ -0,0 +1,7 @@
1
+ # $bl_c, bl_c$
2
+
3
+ <div class="l-block__content">
4
+ <div class="panel panel--block">
5
+ <%= Mastalk::Document.new(body.strip).to_html.gsub(/<p>|<\/p>|\n/, '') %>
6
+ </div>
7
+ </div>
@@ -0,0 +1,5 @@
1
+ # $bl_m, bl_m$
2
+
3
+ <div class="l-block__media">
4
+ <%= Mastalk::Document.new(body.strip).to_html.gsub(/<p>|<\/p>|\n/, '') %>
5
+ </div>
data/mastalk.gemspec CHANGED
@@ -3,11 +3,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'mastalk'
6
- s.version = '0.3.4'
7
- s.date = '2015-02-24'
6
+ s.version = '0.3.5'
7
+ s.date = '2015-03-02'
8
8
  s.summary = 'mastalk'
9
9
  s.description = 'Mastalk markdown extension language'
10
- s.authors = ['Douglas Roper']
10
+ s.authors = ['Douglas Roper', 'Justin Perry']
11
11
  s.email = 'dougdroper@gmail.com'
12
12
  s.files = `git ls-files`.split($/)
13
13
  s.homepage = 'https://github.com/moneyadviceservice/mastalk'
data/spec/mastalk_spec.rb CHANGED
@@ -113,7 +113,7 @@ describe Mastalk::Document do
113
113
  "<table>\n <tbody>\n <tr>\n <td>table</td>\n <td>header</td>\n </tr>\n <tr>\n <td><ul class='yes-no'><li class=\"yes\">yes</li></ul></td>\n <td>here</td>\n </tr>\n </tbody>\n</table>\n"
114
114
  end
115
115
 
116
- it 'pre-processes correctly' do
116
+ it 'outputs ticks inside a table' do
117
117
  expect(subject.to_html).to eq(expected)
118
118
  end
119
119
  end
@@ -125,7 +125,7 @@ describe Mastalk::Document do
125
125
  "<table>\n <tbody>\n <tr>\n <td>table</td>\n <td>header</td>\n </tr>\n <tr>\n <td><ul><li>yes</li></ul></td>\n <td>here</td>\n </tr>\n </tbody>\n</table>\n"
126
126
  end
127
127
 
128
- it 'pre-processes correctly' do
128
+ it 'outputs a bullet list inside a table' do
129
129
  expect(subject.to_html).to eq(expected)
130
130
  end
131
131
  end
@@ -137,7 +137,7 @@ describe Mastalk::Document do
137
137
  "<p><br /> <br /></p>\n"
138
138
  end
139
139
 
140
- it 'pre-processes correctly' do
140
+ it 'outputs a line break' do
141
141
  expect(subject.to_html).to eq(expected)
142
142
  end
143
143
  end
@@ -153,8 +153,45 @@ describe Mastalk::Document do
153
153
  context 'when youtube video' do
154
154
  let(:source) { '({oZ0_U108aZw})' }
155
155
 
156
- it 'includes youtube embed video' do
156
+ it 'outputs the youtube embed video' do
157
157
  expect(subject.to_html).to include('https://www.youtube.com/embed/oZ0_U108aZw')
158
158
  end
159
159
  end
160
+
161
+ context 'block with media and content' do
162
+ let(:source) { '$bl $bl_c Content bl_c$ $bl_m bl_m$ bl$' }
163
+
164
+ let(:expected) do
165
+ %(<div class="l-block">\n <div class="l-block__content"> <div class="panel panel--block"> Content </div></div><div class="l-block__media"> </div>\n</div>\n)
166
+ end
167
+
168
+ it 'outputs a block layout with media and content container blocks' do
169
+ expect(subject.to_html).to eq(expected)
170
+ end
171
+ end
172
+
173
+ context 'collapsable section' do
174
+ let(:source) { '$- -$' }
175
+
176
+ let(:expected) do
177
+ %(<div class="collapsible-section">\n \n\n</div>\n)
178
+ end
179
+
180
+ it 'outputs a collapsible section block' do
181
+ expect(subject.to_html).to eq(expected)
182
+ end
183
+ end
184
+
185
+ context 'collapsable header' do
186
+ let(:source) { '$= Content =$' }
187
+
188
+ let(:expected) do
189
+ %(<div class="collapsible">\n <button class="unstyled-button">\n <span class="icon icon--toggle"></span>\n <span class=\"visually-hidden js-collapsable-hidden\"></span>\n Content \n </button>\n</div>\n)
190
+ end
191
+
192
+ it 'outputs a collapsible header' do
193
+ expect(subject.to_html).to eq(expected)
194
+ end
195
+ end
196
+
160
197
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Roper
8
+ - Justin Perry
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
12
+ date: 2015-03-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: kramdown
@@ -98,6 +99,8 @@ extra_rdoc_files: []
98
99
  files:
99
100
  - ".gitignore"
100
101
  - ".rspec"
102
+ - ".ruby-gemset"
103
+ - ".ruby-version"
101
104
  - ".travis.yml"
102
105
  - Gemfile
103
106
  - README.md
@@ -106,12 +109,14 @@ files:
106
109
  - lib/mastalk/extensions.rb
107
110
  - lib/mastalk/snippets/action_item.html.erb
108
111
  - lib/mastalk/snippets/add_action.html.erb
112
+ - lib/mastalk/snippets/block.html.erb
113
+ - lib/mastalk/snippets/block_content.html.erb
114
+ - lib/mastalk/snippets/block_media.html.erb
109
115
  - lib/mastalk/snippets/break.html.erb
110
116
  - lib/mastalk/snippets/bright_video.html.erb
111
117
  - lib/mastalk/snippets/bullet_points.html.erb
112
118
  - lib/mastalk/snippets/callout.html.erb
113
119
  - lib/mastalk/snippets/collabsible_section.html.erb
114
- - lib/mastalk/snippets/collapsable.html.erb
115
120
  - lib/mastalk/snippets/collapsible_header.html.erb
116
121
  - lib/mastalk/snippets/how.html.erb
117
122
  - lib/mastalk/snippets/no.html.erb
@@ -148,4 +153,3 @@ signing_key:
148
153
  specification_version: 4
149
154
  summary: mastalk
150
155
  test_files: []
151
- has_rdoc:
@@ -1,5 +0,0 @@
1
- # $collapsable
2
-
3
- <div class='collapsable'>
4
- <%= Mastalk::Document.new(body.strip).to_html %>
5
- </div>