livingstyleguide 0.4.2 → 0.5.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: 46e5474b45fd6db4d4ab72944458565bdc636269
4
- data.tar.gz: fcce50f928d5b5a00e906700585e5e8e52f829b2
3
+ metadata.gz: a074be5029c9a4e91b8bf8b23da0ff2d9656c433
4
+ data.tar.gz: 7c0e279055e9f77edc460df6959203f08c61471a
5
5
  SHA512:
6
- metadata.gz: 347923e3694584f86edab22d3f55e8c7cafa1f6a4b18600abce28cd18d53f05dd36ee9e8193037b5ad5bc267a00e1f027a8f956eb44fae21ce5d64ccb3ba1be1
7
- data.tar.gz: 7a8b7a0c7c1e432834f5a1fac159184e8ead32590ca986796b3121d264fc5827ec883ef05d6772a93ecd5290f3baeaa85a4881c9919e7d686676c0fd688532c6
6
+ metadata.gz: 39a2fb00a60f5307240f85cb25378b8c58c580fd2ba00158b31d229ce5b720859e590d09c121d54357b199c6761fa002ed0d72d9c2bb2034e0310dd6a1f0015c
7
+ data.tar.gz: b9eb472613d008aafd1e482f9a6e050f6c1c5e75029cb9c8053c2f0b3f9853a04e68c5aea994470f02ece4d281841eac57d6e248a3e99ce883fd347aef6f6880
data/CHANGELOG.md CHANGED
@@ -4,3 +4,12 @@
4
4
 
5
5
  * Added anchors (ids) to headlines
6
6
 
7
+ ## 0.4.2
8
+
9
+ * Added `display` properties to avoid conflicts with resets
10
+
11
+ ## 0.5.0
12
+
13
+ * Added support for Haml code in examples (`haml-example`,
14
+ `haml-layout-example`)
15
+
@@ -88,6 +88,16 @@ module LivingStyleGuide
88
88
  if %w(example layout-example).include?(language)
89
89
  html = code.gsub(/\*\*\*(.+?)\*\*\*/m, '\\1')
90
90
  %Q(<div class="livingstyleguide--#{language}">\n #{html}\n</div>) + "\n" + block_code(code, 'html')
91
+ elsif %w(haml-example haml-layout-example).include?(language)
92
+ begin
93
+ type = language[5..-1]
94
+ require 'haml'
95
+ Haml::Options.defaults[:attr_wrapper] = '"'
96
+ html = Haml::Engine.new(code).render.strip
97
+ %Q(<div class="livingstyleguide--#{type}">\n #{html}\n</div>) + "\n" + block_code(code, 'html')
98
+ rescue LoadError
99
+ raise "Please make sure `gem 'haml'` is added to your Gemfile."
100
+ end
91
101
  elsif %w(javascript-example).include?(language)
92
102
  javascript = code.gsub(/\*\*\*(.+?)\*\*\*/m, '\\1')
93
103
  %Q(<script>#{javascript}</script>\n) + block_code(code, 'javascript')
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -24,4 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_dependency 'redcarpet'
25
25
 
26
26
  gem.add_development_dependency 'rake'
27
+ gem.add_development_dependency 'haml'
27
28
  end
@@ -0,0 +1,4 @@
1
+ ~~~ haml-example
2
+ %button.button Test
3
+ ~~~
4
+
@@ -33,6 +33,15 @@ class MarkdownTest < Test::Unit::TestCase
33
33
  HTML
34
34
  end
35
35
 
36
+ def test_haml_example
37
+ assert_markdown <<-HTML, 'haml-example.md'
38
+ <div class="livingstyleguide--example">
39
+ <button class="button">Test</button>
40
+ </div>
41
+ <pre class="livingstyleguide--code-block"><code class="livingstyleguide--code">%button.button Test</code></pre>
42
+ HTML
43
+ end
44
+
36
45
  def test_text
37
46
  assert_markdown <<-HTML, 'text.md'
38
47
  <h2 class="livingstyleguide--headline" id="hello-world">Hello World</h2>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livingstyleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Hagenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 2013-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minisyntax
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: haml
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Living Style Guide
98
112
  email:
99
113
  - nico@hagenburger.net
@@ -128,6 +142,7 @@ files:
128
142
  - test/fixtures/markdown/example-with-highlight.md
129
143
  - test/fixtures/markdown/example.md
130
144
  - test/fixtures/markdown/font-example.md
145
+ - test/fixtures/markdown/haml-example.md
131
146
  - test/fixtures/markdown/javascript-example.md
132
147
  - test/fixtures/markdown/layout-example.md
133
148
  - test/fixtures/markdown/text.md
@@ -169,6 +184,7 @@ test_files:
169
184
  - test/fixtures/markdown/example-with-highlight.md
170
185
  - test/fixtures/markdown/example.md
171
186
  - test/fixtures/markdown/font-example.md
187
+ - test/fixtures/markdown/haml-example.md
172
188
  - test/fixtures/markdown/javascript-example.md
173
189
  - test/fixtures/markdown/layout-example.md
174
190
  - test/fixtures/markdown/text.md