livingstyleguide 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a074be5029c9a4e91b8bf8b23da0ff2d9656c433
|
4
|
+
data.tar.gz: 7c0e279055e9f77edc460df6959203f08c61471a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39a2fb00a60f5307240f85cb25378b8c58c580fd2ba00158b31d229ce5b720859e590d09c121d54357b199c6761fa002ed0d72d9c2bb2034e0310dd6a1f0015c
|
7
|
+
data.tar.gz: b9eb472613d008aafd1e482f9a6e050f6c1c5e75029cb9c8053c2f0b3f9853a04e68c5aea994470f02ece4d281841eac57d6e248a3e99ce883fd347aef6f6880
|
data/CHANGELOG.md
CHANGED
@@ -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')
|
data/livingstyleguide.gemspec
CHANGED
@@ -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
|
+
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-
|
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
|