octicons 0.0.0.pre.46beef2 → 9.6.0.pre.76ee47a
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 +4 -4
- data/README.md +116 -2
- data/lib/build/data.json +1 -1
- data/lib/octicons/version.rb +1 -1
- metadata +2 -4
- data/lib/build/svg/lightbulb-16.svg +0 -3
- data/lib/build/svg/north-star.svg +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bc21fb351a43d41e7762c1d3a3e10fc672b182d4a50caa4a4b739b22fa68dce
|
4
|
+
data.tar.gz: c81f963ad929c5a5e6577854b59f1fc0f1e10570aa3d16a794d1c4051856e4f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa8fc08d1283061e23230aec7dbcfbcbd05cddfc7658d4a5b3169d30816bb8ebe4e426ca8e48ae56a2e1ef7da364ccd6c662dc609d2c66faab54e8eb01a60b10
|
7
|
+
data.tar.gz: 5133f4b7d3685acf7794f38b7dca118e268cd65096c73949caa2096f3e5a152a5abca2d79808b39f7b188cf663744095eb399be084c04242adef86b03127571d
|
data/README.md
CHANGED
@@ -1,5 +1,119 @@
|
|
1
|
-
#
|
1
|
+
# Octicons gem
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/octicons)
|
4
|
+
[](https://travis-ci.org/primer/octicons)
|
4
5
|
|
5
|
-
|
6
|
+
> Octicons gem to distribute octicons svg
|
7
|
+
|
8
|
+
## Install
|
9
|
+
|
10
|
+
Add this to your `Gemfile`
|
11
|
+
|
12
|
+
```rb
|
13
|
+
gem 'octicons'
|
14
|
+
```
|
15
|
+
|
16
|
+
Then `bundle install`.
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
```rb
|
21
|
+
require 'octicons'
|
22
|
+
icon = Octicons::Octicon.new("x")
|
23
|
+
icon.to_svg
|
24
|
+
# <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg>
|
25
|
+
```
|
26
|
+
|
27
|
+
## Documentation
|
28
|
+
|
29
|
+
The `Octicon` class takes two arguments. The first is the symbol of the icon, and the second is a hash of arguments representing html attributes
|
30
|
+
|
31
|
+
#### `symbol` _(required)_
|
32
|
+
|
33
|
+
This is the name of the octicon you want to use. For example `alert`. [Full list of icons][octicons-docs]
|
34
|
+
|
35
|
+
#### Options
|
36
|
+
|
37
|
+
* `:height` - When setting the height to a number, the icon will scale to that size. For example, passing `32`, will calculate the width based on the icon's natural size.
|
38
|
+
* `:width` - When setting the width to a number, the icon will scale to that size. For example, passing `32`, will calculate the width based on the icon's natural size.
|
39
|
+
|
40
|
+
If both `:width, :height` are passed into the options hash, then the icon will be sized exactly at those dimensions.
|
41
|
+
|
42
|
+
#### Attributes
|
43
|
+
|
44
|
+
Once initialized, you can read a few properties from the icon.
|
45
|
+
|
46
|
+
##### `symbol`
|
47
|
+
|
48
|
+
Returns the string of the symbol name
|
49
|
+
|
50
|
+
```rb
|
51
|
+
icon = Octicons::Octicon.new("x")
|
52
|
+
icon.symbol
|
53
|
+
# "x"
|
54
|
+
```
|
55
|
+
|
56
|
+
##### `path`
|
57
|
+
|
58
|
+
Path returns the string representation of the path of the icon.
|
59
|
+
|
60
|
+
```rb
|
61
|
+
icon = Octicons::Octicon.new("x")
|
62
|
+
icon.path
|
63
|
+
# <path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path>
|
64
|
+
```
|
65
|
+
|
66
|
+
##### `options`
|
67
|
+
|
68
|
+
This is a hash of all the `options` that will be added to the output tag.
|
69
|
+
|
70
|
+
```rb
|
71
|
+
icon = Octicons::Octicon.new("x")
|
72
|
+
icon.options
|
73
|
+
# {:class=>"octicon octicon-x", :viewBox=>"0 0 12 16", :version=>"1.1", :width=>12, :height=>16, :"aria-hidden"=>"true"}
|
74
|
+
```
|
75
|
+
|
76
|
+
##### `width`
|
77
|
+
|
78
|
+
Width is the icon's true width. Based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon_
|
79
|
+
|
80
|
+
##### `height`
|
81
|
+
|
82
|
+
Height is the icon's true height. Based on the svg view box height. _Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon_
|
83
|
+
|
84
|
+
##### `keywords`
|
85
|
+
|
86
|
+
Returns an array of keywords for the icon. The data comes from the [data file in lib](../data.json). Consider contributing more aliases for the icons.
|
87
|
+
|
88
|
+
```rb
|
89
|
+
icon = Octicons::Octicon.new("x")
|
90
|
+
icon.keywords
|
91
|
+
# ["remove", "close", "delete"]
|
92
|
+
```
|
93
|
+
|
94
|
+
#### Methods
|
95
|
+
|
96
|
+
##### `to_svg`
|
97
|
+
|
98
|
+
Returns a string of the svg tag
|
99
|
+
|
100
|
+
```rb
|
101
|
+
icon = Octicons::Octicon.new("x")
|
102
|
+
icon.to_svg
|
103
|
+
# <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg>
|
104
|
+
```
|
105
|
+
|
106
|
+
## Documentation
|
107
|
+
|
108
|
+
For a full list of options available, see the [octicons_gem documentation](../octicons_gem/#documentation)
|
109
|
+
|
110
|
+
## License
|
111
|
+
|
112
|
+
(c) GitHub, Inc.
|
113
|
+
|
114
|
+
When using the GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).
|
115
|
+
|
116
|
+
[MIT](./LICENSE)
|
117
|
+
|
118
|
+
[octicons]: https://github.com/primer/octicons
|
119
|
+
[octicons-docs]: https://octicons.github.com/
|
data/lib/build/data.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"alert":{"name":"alert","keywords":["warning","triangle","exclamation","point"],"width":16,"height":16,"path":"
|
1
|
+
{"alert":{"name":"alert","keywords":["warning","triangle","exclamation","point"],"width":16,"height":16,"path":"
|
data/lib/octicons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octicons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.6.0.pre.76ee47a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -137,7 +137,6 @@ files:
|
|
137
137
|
- lib/build/svg/keyboard.svg
|
138
138
|
- lib/build/svg/law.svg
|
139
139
|
- lib/build/svg/light-bulb.svg
|
140
|
-
- lib/build/svg/lightbulb-16.svg
|
141
140
|
- lib/build/svg/line-arrow-down.svg
|
142
141
|
- lib/build/svg/line-arrow-left.svg
|
143
142
|
- lib/build/svg/line-arrow-right.svg
|
@@ -161,7 +160,6 @@ files:
|
|
161
160
|
- lib/build/svg/mortar-board.svg
|
162
161
|
- lib/build/svg/mute.svg
|
163
162
|
- lib/build/svg/no-newline.svg
|
164
|
-
- lib/build/svg/north-star.svg
|
165
163
|
- lib/build/svg/note.svg
|
166
164
|
- lib/build/svg/octoface.svg
|
167
165
|
- lib/build/svg/organization.svg
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 1.5C5.63731 1.5 4 3.19074 4 5.25012C4 6.23377 4.42403 6.87528 4.98447 7.55371C5.05112 7.63439 5.12301 7.71927 5.1976 7.80732C5.42078 8.07081 5.66802 8.3627 5.87055 8.65525C6.15526 9.06649 6.40778 9.55128 6.49246 10.1441C6.55104 10.5541 6.26612 10.934 5.85607 10.9926C5.44602 11.0512 5.06612 10.7662 5.00754 10.3562C4.96722 10.074 4.84474 9.80875 4.63726 9.50906C4.47951 9.2812 4.30278 9.07249 4.0961 8.82841L4.09599 8.82829C4.01188 8.72895 3.9228 8.62376 3.82803 8.50903C3.20097 7.74996 2.5 6.76647 2.5 5.25012C2.5 2.30951 4.86269 0 8 0C11.1373 0 13.5 2.30951 13.5 5.25012C13.5 6.76647 12.799 7.74996 12.172 8.50903C12.0773 8.62367 11.9883 8.72878 11.9042 8.82805L11.904 8.82833L11.9039 8.82841L11.9039 8.82846L11.9038 8.82854C11.6972 9.07256 11.5205 9.28124 11.3627 9.50906C11.1553 9.80875 11.0328 10.074 10.9925 10.3562C10.9339 10.7662 10.554 11.0512 10.1439 10.9926C9.73388 10.934 9.44896 10.5541 9.50754 10.1441C9.59222 9.55128 9.84474 9.06649 10.1294 8.65525C10.332 8.3627 10.5792 8.07081 10.8024 7.80732C10.877 7.71927 10.9489 7.63439 11.0155 7.55371C11.576 6.87528 12 6.23377 12 5.25012C12 3.19074 10.3627 1.5 8 1.5ZM6 15.25C6 14.8358 6.33579 14.5 6.75 14.5H9.25C9.66421 14.5 10 14.8358 10 15.25C10 15.6642 9.66421 16 9.25 16H6.75C6.33579 16 6 15.6642 6 15.25ZM5.75 12C5.33579 12 5 12.3358 5 12.75C5 13.1642 5.33579 13.5 5.75 13.5H10.25C10.6642 13.5 11 13.1642 11 12.75C11 12.3358 10.6642 12 10.25 12H5.75Z" fill="black"/>
|
3
|
-
</svg>
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M8.5 0.75C8.5 0.335786 8.16421 0 7.75 0C7.33579 0 7 0.335786 7 0.75V5.93933L4.39125 3.33058C4.09836 3.03768 3.62348 3.03768 3.33059 3.33058C3.03769 3.62347 3.0377 4.09835 3.33059 4.39124L5.93935 7H0.75C0.335787 7 0 7.33579 0 7.75C0 8.16421 0.335787 8.5 0.75 8.5H5.93936L3.33059 11.1088C3.0377 11.4017 3.0377 11.8765 3.33059 12.1694C3.62349 12.4623 4.09836 12.4623 4.39125 12.1694L7 9.56068V14.75C7 15.1642 7.33579 15.5 7.75 15.5C8.16421 15.5 8.5 15.1642 8.5 14.75V9.56065L11.1088 12.1694C11.4017 12.4623 11.8765 12.4623 12.1694 12.1694C12.4623 11.8765 12.4623 11.4016 12.1694 11.1088L9.56067 8.5H14.75C15.1642 8.5 15.5 8.16421 15.5 7.75C15.5 7.33579 15.1642 7 14.75 7H9.56068L12.1694 4.39125C12.4623 4.09836 12.4623 3.62349 12.1694 3.33059C11.8765 3.0377 11.4017 3.0377 11.1088 3.33059L8.5 5.93936V0.75Z" />
|
3
|
-
</svg>
|