jekyll-octicons 1.1.0 → 2.0.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 +8 -8
- data/README.md +1 -1
- data/lib/jekyll-octicons.rb +24 -8
- data/lib/jekyll-octicons/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWE3NGQzMjMzZmZkOTI4MTdkYzk1ZjMxMTljNGRkZDE1OTgzZTdiNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDhhMTVkM2JhNzdkNThhODYwYmJlZDNlZTA5NjYxMzM5NDNhYmRjYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTU1ODIyMTNhMjFlY2VjZGJmMmI4NDFiYzczODFkNTZiNTcyMTE4NjNmODc0
|
10
|
+
OWFjZTFmNzM1MTE1ZGM0ZTllNGYyYjQwODgwNDI1YzA3ZTE1ZGEwNGJjMmI4
|
11
|
+
MjBhZGU1YmUwNzhmNzY0Y2IzNjViY2Q0NGU1NTllNTk5ZTA3OWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzliYWZmOWU3NDg3NmM5Y2JkNmFkNmE3MGI3ODZjNzI2ZWRjNWJjNWNkYjNi
|
14
|
+
YzFmOTc2YmQ2ZmQ4ZTVjNGNkMDBkMTc3OGRiNDg1OWYwNDE5OGNjN2Q1ZTFh
|
15
|
+
OGI2NTY3MWY4NWZmODAwODM1ZGVlODhjOWE0N2Q0YzA1ZjY2NzE=
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ This jekyll liquid tag, is a plugin that will let you easily include svg [octico
|
|
25
25
|
3. Use this tag in your jekyll templates
|
26
26
|
|
27
27
|
```
|
28
|
-
{% octicon alert
|
28
|
+
{% octicon alert height:32 class:"right left" aria-label:hi %}
|
29
29
|
```
|
30
30
|
|
31
31
|
The minimum CSS you'll need in your jekyll site is in the [octicons][octicons] repository. You can also npm install that package and include `build/octicons.css` in your styles.
|
data/lib/jekyll-octicons.rb
CHANGED
@@ -22,26 +22,42 @@ module Jekyll
|
|
22
22
|
def initialize(tag_name, markup, options)
|
23
23
|
super
|
24
24
|
@markup = markup
|
25
|
-
|
25
|
+
# If there's interpoaltion going on, we need to do this in render
|
26
|
+
prepare(markup) unless match = markup.match(Variable)
|
26
27
|
end
|
27
28
|
|
28
29
|
def render(context)
|
29
|
-
@markup
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
::Octicons::Octicon.new(@options).to_svg
|
30
|
+
prepare(interpolate(@markup, context)) if match = @markup.match(Variable)
|
31
|
+
|
32
|
+
return nil if @symbol.nil?
|
33
|
+
::Octicons::Octicon.new(@symbol, @options).to_svg
|
34
34
|
end
|
35
35
|
|
36
36
|
private
|
37
37
|
|
38
|
+
def interpolate(markup, context)
|
39
|
+
markup.scan Variable do |variable|
|
40
|
+
markup = markup.gsub(Variable, lookup_variable(context, variable.first))
|
41
|
+
end
|
42
|
+
markup
|
43
|
+
end
|
44
|
+
|
45
|
+
def prepare(markup)
|
46
|
+
@symbol = symbol(markup)
|
47
|
+
@options = string_to_hash(markup)
|
48
|
+
end
|
49
|
+
|
50
|
+
def symbol(markup)
|
51
|
+
if match = markup.match(Syntax)
|
52
|
+
match[1]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
38
56
|
# Create a ruby hash from a string passed by the jekyll tag
|
39
57
|
def string_to_hash(markup)
|
40
58
|
options = {}
|
41
59
|
|
42
60
|
if match = markup.match(Syntax)
|
43
|
-
options[:symbol] = match[1]
|
44
|
-
|
45
61
|
markup.scan(TagAttributes) do |key, value|
|
46
62
|
options[key.to_sym] = value.gsub(/\A"|"\z/, '')
|
47
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-octicons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
41
|
description: A jekyll liquid plugin that makes including svg Octicons simple.
|
42
42
|
email:
|
43
43
|
- support@github.com
|