octicons 0.0.0.pre.67c4fe9 → 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 -7
- data/lib/build/svg/no-entry-16.svg +0 -3
- data/lib/build/svg/north-star.svg +0 -3
- data/lib/build/svg/report-16.svg +0 -3
- data/lib/build/svg/report-24.svg +0 -4
- data/lib/build/svg/workflow-24.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
|
@@ -159,9 +159,7 @@ files:
|
|
159
159
|
- lib/build/svg/mirror.svg
|
160
160
|
- lib/build/svg/mortar-board.svg
|
161
161
|
- lib/build/svg/mute.svg
|
162
|
-
- lib/build/svg/no-entry-16.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
|
@@ -191,8 +189,6 @@ files:
|
|
191
189
|
- lib/build/svg/repo-template-private.svg
|
192
190
|
- lib/build/svg/repo-template.svg
|
193
191
|
- lib/build/svg/repo.svg
|
194
|
-
- lib/build/svg/report-16.svg
|
195
|
-
- lib/build/svg/report-24.svg
|
196
192
|
- lib/build/svg/report.svg
|
197
193
|
- lib/build/svg/request-changes.svg
|
198
194
|
- lib/build/svg/rocket.svg
|
@@ -237,7 +233,6 @@ files:
|
|
237
233
|
- lib/build/svg/verified.svg
|
238
234
|
- lib/build/svg/versions.svg
|
239
235
|
- lib/build/svg/watch.svg
|
240
|
-
- lib/build/svg/workflow-24.svg
|
241
236
|
- lib/build/svg/workflow-all.svg
|
242
237
|
- lib/build/svg/workflow.svg
|
243
238
|
- lib/build/svg/x.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="M2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8ZM8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1ZM11.25 8.75011C11.6642 8.75011 12 8.41433 12 8.00011C12 7.5859 11.6642 7.25011 11.25 7.25011L4.75 7.25011C4.33579 7.25011 4 7.5859 4 8.00011C4 8.41433 4.33579 8.75011 4.75 8.75011L11.25 8.75011Z" 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>
|
data/lib/build/svg/report-16.svg
DELETED
@@ -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="M1.75 1.5C1.61193 1.5 1.5 1.61193 1.5 1.75V11.25C1.5 11.3881 1.61193 11.5 1.75 11.5H3.75C4.16421 11.5 4.5 11.8358 4.5 12.25V14.4393L7.21967 11.7197C7.36032 11.579 7.55109 11.5 7.75 11.5H14.25C14.3881 11.5 14.5 11.3881 14.5 11.25V1.75C14.5 1.61193 14.3881 1.5 14.25 1.5H1.75ZM0 1.75C0 0.783502 0.783501 0 1.75 0H14.25C15.2165 0 16 0.783502 16 1.75V11.25C16 12.2165 15.2165 13 14.25 13H8.06066L5.48744 15.5732C5.21418 15.8465 4.84356 16 4.45711 16C3.65237 16 3 15.3476 3 14.5429V13H1.75C0.783502 13 0 12.2165 0 11.25V1.75ZM9 9C9 9.55229 8.55229 10 8 10C7.44772 10 7 9.55229 7 9C7 8.44771 7.44772 8 8 8C8.55229 8 9 8.44771 9 9ZM8.75 3.75C8.75 3.33579 8.41421 3 8 3C7.58579 3 7.25 3.33579 7.25 3.75V6.25C7.25 6.66421 7.58579 7 8 7C8.41421 7 8.75 6.66421 8.75 6.25V3.75Z" fill="black"/>
|
3
|
-
</svg>
|
data/lib/build/svg/report-24.svg
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect width="24" height="24" fill="white"/>
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.25 4C3.11193 4 3 4.11193 3 4.25V16.75C3 16.8881 3.11193 17 3.25 17H5.75C6.16421 17 6.5 17.3358 6.5 17.75V20.9393L9.92678 17.5126C10.255 17.1844 10.7001 17 11.1642 17H20.75C20.8881 17 21 16.8881 21 16.75V4.25C21 4.11193 20.8881 4 20.75 4H3.25ZM1.5 4.25C1.5 3.2835 2.2835 2.5 3.25 2.5H20.75C21.7165 2.5 22.5 3.2835 22.5 4.25V16.75C22.5 17.7165 21.7165 18.5 20.75 18.5H11.1642C11.0979 18.5 11.0343 18.5263 10.9874 18.5732L7.48744 22.0732C7.21418 22.3465 6.84356 22.5 6.45711 22.5C5.65237 22.5 5 21.8476 5 21.0429V18.5H3.25C2.2835 18.5 1.5 17.7165 1.5 16.75V4.25ZM12 6C12.4142 6 12.75 6.33579 12.75 6.75V10.75C12.75 11.1642 12.4142 11.5 12 11.5C11.5858 11.5 11.25 11.1642 11.25 10.75V6.75C11.25 6.33579 11.5858 6 12 6ZM12 15C12.5523 15 13 14.5523 13 14C13 13.4477 12.5523 13 12 13C11.4477 13 11 13.4477 11 14C11 14.5523 11.4477 15 12 15Z" fill="black"/>
|
4
|
-
</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="M2.75 2.5C2.61193 2.5 2.5 2.61193 2.5 2.75V9.25C2.5 9.38807 2.61193 9.5 2.75 9.5H9.25C9.38807 9.5 9.5 9.38807 9.5 9.25V2.75C9.5 2.61193 9.38807 2.5 9.25 2.5H2.75ZM1 2.75C1 1.7835 1.7835 1 2.75 1H9.25C10.2165 1 11 1.7835 11 2.75V9.25C11 10.2165 10.2165 11 9.25 11H6.5V15.25C6.5 16.4926 7.50736 17.5 8.75 17.5H13V14.75C13 13.7835 13.7835 13 14.75 13H21.25C22.2165 13 23 13.7835 23 14.75V21.25C23 22.2165 22.2165 23 21.25 23H14.75C13.7835 23 13 22.2165 13 21.25V19H8.75C6.67893 19 5 17.3211 5 15.25V11H2.75C1.7835 11 1 10.2165 1 9.25V2.75ZM14.75 14.5C14.6119 14.5 14.5 14.6119 14.5 14.75V21.25C14.5 21.3881 14.6119 21.5 14.75 21.5H21.25C21.3881 21.5 21.5 21.3881 21.5 21.25V14.75C21.5 14.6119 21.3881 14.5 21.25 14.5H14.75Z" fill="black"/>
|
3
|
-
</svg>
|