octicons 0.0.0.pre.a7a9fff → 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 -1
- data/lib/build/svg/north-star.svg +0 -3
- data/lib/build/svg/report-16.svg +0 -1
- data/lib/build/svg/report-24.svg +0 -1
- 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 +0,0 @@
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 8a5.5 5.5 0 1111 0 5.5 5.5 0 01-11 0zM8 1a7 7 0 100 14A7 7 0 008 1zm3.25 7.75a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5z"/></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 +0,0 @@
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.75 1.5a.25.25 0 00-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h6.5a.25.25 0 00.25-.25v-9.5a.25.25 0 00-.25-.25H1.75zM0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0114.25 13H8.06l-2.573 2.573A1.457 1.457 0 013 14.543V13H1.75A1.75 1.75 0 010 11.25v-9.5zM9 9a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"/></svg>
|
data/lib/build/svg/report-24.svg
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.25 4a.25.25 0 00-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 01.75.75v3.19l3.427-3.427A1.75 1.75 0 0111.164 17h9.586a.25.25 0 00.25-.25V4.25a.25.25 0 00-.25-.25H3.25zm-1.75.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 01-1.75 1.75h-9.586a.25.25 0 00-.177.073l-3.5 3.5A1.457 1.457 0 015 21.043V18.5H3.25a1.75 1.75 0 01-1.75-1.75V4.25zM12 6a.75.75 0 01.75.75v4a.75.75 0 01-1.5 0v-4A.75.75 0 0112 6zm0 9a1 1 0 100-2 1 1 0 000 2z"/></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>
|