octicons 0.0.0.pre.7bfb18d → 9.6.0.pre.76ee47a
Sign up to get free protection for your applications and to get access to all the features.
- 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 -5
- data/lib/build/svg/light-bulb-16.svg +0 -3
- data/lib/build/svg/light-bulb-24.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
|
[![Gem version](https://img.shields.io/gem/v/octicons.svg)](https://rubygems.org/gems/octicons)
|
4
|
+
[![Build Status](https://travis-ci.org/primer/octicons.svg?branch=master)](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
|
@@ -136,8 +136,6 @@ files:
|
|
136
136
|
- lib/build/svg/key.svg
|
137
137
|
- lib/build/svg/keyboard.svg
|
138
138
|
- lib/build/svg/law.svg
|
139
|
-
- lib/build/svg/light-bulb-16.svg
|
140
|
-
- lib/build/svg/light-bulb-24.svg
|
141
139
|
- lib/build/svg/light-bulb.svg
|
142
140
|
- lib/build/svg/line-arrow-down.svg
|
143
141
|
- lib/build/svg/line-arrow-left.svg
|
@@ -162,7 +160,6 @@ files:
|
|
162
160
|
- lib/build/svg/mortar-board.svg
|
163
161
|
- lib/build/svg/mute.svg
|
164
162
|
- lib/build/svg/no-newline.svg
|
165
|
-
- lib/build/svg/north-star.svg
|
166
163
|
- lib/build/svg/note.svg
|
167
164
|
- lib/build/svg/octoface.svg
|
168
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="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 2.5C8.18992 2.5 5.5 5.2434 5.5 8.61852C5.5 10.1551 6.13164 11.1908 6.92487 12.1795C7.09672 12.3937 7.27206 12.6008 7.45239 12.8138L7.54771 12.9264C7.75835 13.1756 7.97456 13.434 8.17724 13.7C8.58211 14.2313 8.96122 14.8281 9.17348 15.534C9.29276 15.9307 9.0679 16.3489 8.67123 16.4682C8.27457 16.5875 7.85631 16.3626 7.73702 15.966C7.59893 15.5068 7.3397 15.0757 6.98415 14.6091C6.80661 14.3761 6.61208 14.1431 6.4022 13.8948L6.30999 13.7859C6.13007 13.5734 5.94023 13.3492 5.75485 13.1182C4.87063 12.016 4 10.651 4 8.61852C4 4.36216 7.41531 1 12 1C16.5846 1 19.9999 4.36216 19.9999 8.61852C19.9999 10.651 19.1293 12.016 18.2451 13.1182C18.0597 13.3492 17.8699 13.5733 17.6901 13.7857L17.69 13.7858L17.5977 13.8948C17.3878 14.1431 17.1933 14.3761 17.0158 14.6091C16.6602 15.0757 16.401 15.5068 16.2629 15.966C16.1436 16.3626 15.7254 16.5875 15.3287 16.4682C14.932 16.3489 14.7072 15.9307 14.8264 15.534C15.0387 14.8281 15.4178 14.2313 15.8227 13.7C16.0254 13.434 16.2416 13.1756 16.4522 12.9264L16.5476 12.8138L16.5476 12.8137L16.5478 12.8135C16.728 12.6006 16.9033 12.3936 17.0751 12.1795C17.8683 11.1908 18.4999 10.1551 18.4999 8.61852C18.4999 5.2434 15.81 2.5 12 2.5ZM9.5 21.75C9.5 21.3358 9.83579 21 10.25 21H13.75C14.1642 21 14.5 21.3358 14.5 21.75C14.5 22.1642 14.1642 22.5 13.75 22.5H10.25C9.83579 22.5 9.5 22.1642 9.5 21.75ZM8.75 18C8.33579 18 8 18.3358 8 18.75C8 19.1642 8.33579 19.5 8.75 19.5H15.25C15.6642 19.5 16 19.1642 16 18.75C16 18.3358 15.6642 18 15.25 18H8.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>
|