livingstyleguide 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -86,6 +86,9 @@ module LivingStyleGuide
86
86
  if %w(example layout-example).include?(language)
87
87
  html = code.gsub(/\*\*\*(.+?)\*\*\*/m, '\\1')
88
88
  %Q(<div class="livingstyleguide--#{language}">\n #{html}\n</div>) + "\n" + block_code(code, 'html')
89
+ elsif %w(javascript-example).include?(language)
90
+ javascript = code.gsub(/\*\*\*(.+?)\*\*\*/m, '\\1')
91
+ %Q(<script>#{javascript}</script>\n) + block_code(code, 'javascript')
89
92
  else
90
93
  code = ERB::Util.html_escape(code).gsub(/&quot;/, '"')
91
94
  code = ::MiniSyntax.highlight(code.strip, language.to_s.strip.to_sym)
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency 'minisyntax'
21
- gem.add_dependency 'middleman', '>= 3.0.9'
21
+ gem.add_dependency 'middleman', '~> 3'
22
22
  gem.add_dependency 'compass'
23
23
  gem.add_dependency 'sass'
24
24
  gem.add_dependency 'redcarpet'
@@ -37,6 +37,11 @@
37
37
 
38
38
  q {
39
39
  color: lighten($livingstyleguide--code-color, 30%);
40
+
41
+ &:before,
42
+ &:after {
43
+ content: "";
44
+ }
40
45
  }
41
46
 
42
47
  var {
@@ -0,0 +1,4 @@
1
+ ~~~ javascript-example
2
+ alert("Hello world!");
3
+ ~~~
4
+
@@ -105,4 +105,11 @@ class MarkdownTest < Test::Unit::TestCase
105
105
  HTML
106
106
  end
107
107
 
108
+ def test_javascript_example
109
+ assert_markdown <<-HTML, 'javascript-example.md'
110
+ <script>alert("Hello world!"); </script>
111
+ <pre class="livingstyleguide--code-block"><code class="livingstyleguide--code">alert(<q>"<b>Hello</b> world!"</q>);</code></pre>
112
+ HTML
113
+ end
114
+
108
115
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livingstyleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-11 00:00:00.000000000 Z
12
+ date: 2013-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minisyntax
@@ -32,17 +32,17 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 3.0.9
37
+ version: '3'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 3.0.9
45
+ version: '3'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: compass
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -140,6 +140,7 @@ files:
140
140
  - test/fixtures/markdown/example-with-highlight.md
141
141
  - test/fixtures/markdown/example.md
142
142
  - test/fixtures/markdown/font-example.md
143
+ - test/fixtures/markdown/javascript-example.md
143
144
  - test/fixtures/markdown/layout-example.md
144
145
  - test/fixtures/markdown/text.md
145
146
  - test/fixtures/markdown/variables.md
@@ -164,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
165
  version: '0'
165
166
  segments:
166
167
  - 0
167
- hash: -2420325218216024458
168
+ hash: -262664315329219580
168
169
  required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  none: false
170
171
  requirements:
@@ -173,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
174
  version: '0'
174
175
  segments:
175
176
  - 0
176
- hash: -2420325218216024458
177
+ hash: -262664315329219580
177
178
  requirements: []
178
179
  rubyforge_project:
179
180
  rubygems_version: 1.8.23
@@ -187,6 +188,7 @@ test_files:
187
188
  - test/fixtures/markdown/example-with-highlight.md
188
189
  - test/fixtures/markdown/example.md
189
190
  - test/fixtures/markdown/font-example.md
191
+ - test/fixtures/markdown/javascript-example.md
190
192
  - test/fixtures/markdown/layout-example.md
191
193
  - test/fixtures/markdown/text.md
192
194
  - test/fixtures/markdown/variables.md