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 +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/README.md +35 -0
- data/lib/mastalk/extensions.rb +1 -1
- data/lib/mastalk/snippets/block.html.erb +5 -0
- data/lib/mastalk/snippets/block_content.html.erb +7 -0
- data/lib/mastalk/snippets/block_media.html.erb +5 -0
- data/mastalk.gemspec +3 -3
- data/spec/mastalk_spec.rb +41 -4
- metadata +8 -4
- data/lib/mastalk/snippets/collapsable.html.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e34ab5804d40bf3035fb0443125facc8de97eeb2
|
4
|
+
data.tar.gz: 70d8d346885296ce978fb0bd9fb077bf05fceb2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/mastalk/extensions.rb
CHANGED
@@ -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)
|
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.
|
7
|
-
s.date = '2015-02
|
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 '
|
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 '
|
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 '
|
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 '
|
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
|
+
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
|
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:
|