octicons 0.0.0.pre.325affe → 9.5.0.pre.0fa009c
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/build/svg/internal-repo.svg +3 -1
- data/lib/octicons/version.rb +1 -1
- metadata +2 -6
- data/lib/build/svg/logo-gist-16.svg +0 -3
- data/lib/build/svg/logo-github-16.svg +0 -3
- data/lib/build/svg/north-star.svg +0 -1
- data/lib/build/svg/octoface-16.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: 17b1f444d2b096d370d44cabfd769f1c431787f4fedb1960cc4ed82042db3bcb
|
4
|
+
data.tar.gz: fbca866dd2251d541c7952c6a6004484a2be58b6f9c5e8d7fc25e2ca0b0d539e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9efa41a2937b4c8197a8ac4823a4f888e9caa6c8c55a6f92d2a1d20870b266daf56d9a9a6da303e0db4c28960f0f941714859024775b4053c2ec77f2e56a1057
|
7
|
+
data.tar.gz: 7d0dc01fba81ae299b1cb8f0da3b3c1789328c63bae03f2249f23dbe7dfa32897dd0ff23ac6ce61b26b995c3bd8c629727f0f38f0e3598374a18b575fda75254
|
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":"
|
@@ -1 +1,3 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="16" viewBox="0 0 13 16"
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="16" viewBox="0 0 13 16" >
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 0H9v1a1 1 0 00-1 1H7a1 1 0 00-1 1v1H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h1v1l1-.5 1 .5v-1h4c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1H7V3h1a1 1 0 001-1h1a1 1 0 001 1h1v13h1V3a1 1 0 00-1-1h-1a1 1 0 00-1-1V0zM8 12H2V5h6v7zm-7 1h1v1H1v-1zm7 0v1H4v-1h4zm3-9h-1v2h1V4zm0 3h-1v2h1V7zm0 3h-1v2h1v-2zm0 3h-1v2h1v-2zm-7-2H3v-1h1v1zm0-5H3v1h1V6zm0 2H3v1h1V8z"/>
|
3
|
+
</svg>
|
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.5.0.pre.0fa009c
|
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-04
|
11
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -147,9 +147,7 @@ files:
|
|
147
147
|
- lib/build/svg/list-unordered.svg
|
148
148
|
- lib/build/svg/location.svg
|
149
149
|
- lib/build/svg/lock.svg
|
150
|
-
- lib/build/svg/logo-gist-16.svg
|
151
150
|
- lib/build/svg/logo-gist.svg
|
152
|
-
- lib/build/svg/logo-github-16.svg
|
153
151
|
- lib/build/svg/logo-github.svg
|
154
152
|
- lib/build/svg/mail-read.svg
|
155
153
|
- lib/build/svg/mail.svg
|
@@ -162,9 +160,7 @@ 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
|
-
- lib/build/svg/octoface-16.svg
|
168
164
|
- lib/build/svg/octoface.svg
|
169
165
|
- lib/build/svg/organization.svg
|
170
166
|
- lib/build/svg/package.svg
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.7 8.73H7.15V12.75C6.6 13.02 5.51 13.09 4.62 13.09C2.06 13.09 1.15 10.89 1.15 8.04C1.15 5.19 2.06 2.98 4.63 2.98C5.91 2.98 6.69 3.21 7.91 3.71V2.66C7.27 2.33 6.25 2 4.63 2C1.13 2 0 4.69 0 8.03C0 11.37 1.11 14.06 4.63 14.06C6.27 14.06 7.44 13.79 8.22 13.42V7.73H4.7V8.73ZM11.09 12.45V6.06H10.04V12.34C10.04 13.59 10.62 14.06 11.76 14.06V13.17C11.28 13.17 11.09 13.01 11.09 12.47V12.45ZM11.34 3.73001C11.34 3.29001 11.01 2.95001 10.56 2.95001C10.11 2.95001 9.79 3.29001 9.79 3.73001C9.79 4.17001 10.12 4.51001 10.56 4.51001C11 4.51001 11.34 4.17001 11.34 3.73001ZM15.68 9.42C14.18 9.29 13.9 8.94 13.9 8.25C13.9 7.48 14.23 6.91 15.78 6.91C16.83 6.91 17.44 7.07 18.05 7.27V6.33C17.36 6.03 16.53 5.94 15.8 5.94C13.6 5.94 12.88 7.14 12.88 8.25C12.88 9.33 13.35 10.13 15.61 10.33C17.16 10.46 17.38 10.96 17.38 11.67C17.38 12.4 16.94 13.09 15.32 13.09C14.21 13.09 13.46 12.9 12.99 12.73V13.67C13.49 13.87 14.57 14.06 15.32 14.06C17.7 14.06 18.46 12.86 18.46 11.65C18.46 10.37 17.93 9.62 15.71 9.42H15.69H15.68ZM24.26 6.95003V6.09003H21.84V3.59003L20.76 3.90003V6.01003L19.2 6.45003V6.93003H20.76V11.93C20.76 13.46 21.95 14.06 23.26 14.06C23.45 14.06 23.78 14.04 23.95 14.01V13.12C23.76 13.15 23.54 13.15 23.34 13.15C22.37 13.15 21.84 12.76 21.84 11.81V6.94003H24.26V6.96003V6.95003Z" fill="#1B1F23"/>
|
3
|
-
</svg>
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg width="45" height="16" viewBox="0 0 45 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.53 12.0301H18.51C18.519 12.0301 18.525 12.0391 18.534 12.0411C18.535 12.0411 18.539 12.0401 18.54 12.0401L18.53 12.0301ZM18.534 12.0411C18.441 12.0421 18.207 12.0901 17.96 12.0901C17.18 12.0901 16.91 11.7301 16.91 11.2601V8.13008H18.5C18.59 8.13008 18.66 8.05008 18.66 7.94008V6.24008C18.66 6.15008 18.58 6.07008 18.5 6.07008H16.91V3.96008C16.91 3.88008 16.86 3.83008 16.77 3.83008H14.61C14.52 3.83008 14.47 3.88008 14.47 3.96008V6.13008C14.47 6.13008 13.38 6.40008 13.31 6.41008C13.23 6.43008 13.18 6.50008 13.18 6.58008V7.94008C13.18 8.05008 13.26 8.13008 13.35 8.13008H14.46V11.4101C14.46 13.8501 16.16 14.1001 17.32 14.1001C17.85 14.1001 18.49 13.9301 18.59 13.8801C18.65 13.8601 18.68 13.7901 18.68 13.7201V12.2201C18.68 12.1211 18.612 12.0551 18.534 12.0411ZM42.23 9.84004C42.23 8.03004 41.5 7.79004 40.73 7.87004C40.13 7.91004 39.65 8.21004 39.65 8.21004V11.73C39.65 11.73 40.14 12.07 40.87 12.09C41.9 12.12 42.23 11.75 42.23 9.84004ZM44.66 9.6801C44.66 13.1101 43.55 14.0901 41.61 14.0901C39.97 14.0901 39.09 13.2601 39.09 13.2601C39.09 13.2601 39.05 13.7201 39 13.7801C38.97 13.8401 38.92 13.8601 38.86 13.8601H37.38C37.28 13.8601 37.19 13.7801 37.19 13.6901L37.21 2.5801C37.21 2.4901 37.29 2.4101 37.38 2.4101H39.51C39.6 2.4101 39.68 2.4901 39.68 2.5801V6.3501C39.68 6.3501 40.5 5.8201 41.7 5.8201L41.69 5.8001C42.89 5.8001 44.66 6.25009 44.66 9.6801ZM35.94 6.07007H35.93H33.84C33.73 6.07007 33.67 6.15007 33.67 6.26007V11.7001C33.67 11.7001 33.12 12.0901 32.37 12.0901C31.62 12.0901 31.4 11.7501 31.4 11.0001V6.25007C31.4 6.16007 31.32 6.08007 31.23 6.08007H29.09C29 6.08007 28.92 6.16007 28.92 6.25007V11.3601C28.92 13.5601 30.15 14.1101 31.84 14.1101C33.23 14.1101 34.36 13.3401 34.36 13.3401C34.36 13.3401 34.41 13.7301 34.44 13.7901C34.46 13.8401 34.53 13.8801 34.6 13.8801H35.94C36.05 13.8801 36.11 13.8001 36.11 13.7101L36.13 6.24007C36.13 6.15007 36.05 6.07007 35.94 6.07007ZM12.24 6.06006H10.11C10.02 6.06006 9.94 6.15006 9.94 6.26006V13.6001C9.94 13.8001 10.07 13.8701 10.24 13.8701H12.16C12.36 13.8701 12.41 13.7801 12.41 13.6001V6.24006V6.23006C12.41 6.14006 12.33 6.06006 12.24 6.06006ZM11.19 2.68005C10.42 2.68005 9.81 3.29005 9.81 4.06005C9.81 4.83005 10.42 5.44005 11.19 5.44005C11.94 5.44005 12.55 4.83005 12.55 4.06005C12.55 3.29005 11.94 2.68005 11.19 2.68005ZM27.68 2.43005H25.57C25.48 2.43005 25.4 2.51005 25.4 2.60005V6.69005H22.09V2.60005C22.09 2.51005 22.01 2.43005 21.92 2.43005H19.79C19.7 2.43005 19.62 2.51005 19.62 2.60005V13.7101C19.62 13.8001 19.71 13.8801 19.79 13.8801H21.92C22.01 13.8801 22.09 13.8001 22.09 13.7101V8.96005H25.4L25.38 13.7101C25.38 13.8001 25.46 13.8801 25.55 13.8801H27.68C27.77 13.8801 27.85 13.8001 27.85 13.7101V2.60005C27.85 2.51005 27.77 2.43005 27.68 2.43005ZM8.81 7.35007V13.0901C8.81 13.1301 8.8 13.2001 8.75 13.2201C8.75 13.2201 7.5 14.1101 5.44 14.1101C2.95 14.1101 0 13.3301 0 8.19007C0 3.05007 2.58 1.99007 5.1 2.00007C7.28 2.00007 8.16 2.49007 8.3 2.58007C8.34 2.63007 8.36 2.67007 8.36 2.72007L7.94 4.50007C7.94 4.59007 7.85 4.70007 7.74 4.67007C7.38 4.56007 6.84 4.34007 5.57 4.34007C4.1 4.34007 2.52 4.76007 2.52 8.07007C2.52 11.3801 4.02 11.7701 5.1 11.7701C6.02 11.7701 6.35 11.6601 6.35 11.6601V9.36007H4.88C4.77 9.36007 4.69 9.28007 4.69 9.19007V7.35007C4.69 7.26007 4.77 7.18007 4.88 7.18007H8.62C8.73 7.18007 8.81 7.26007 8.81 7.35007Z" fill="#1B1F23"/>
|
3
|
-
</svg>
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8.5.75a.75.75 0 00-1.5 0v5.19L4.391 3.33a.75.75 0 10-1.06 1.061L5.939 7H.75a.75.75 0 000 1.5h5.19l-2.61 2.609a.75.75 0 101.061 1.06L7 9.561v5.189a.75.75 0 001.5 0V9.56l2.609 2.61a.75.75 0 101.06-1.061L9.561 8.5h5.189a.75.75 0 000-1.5H9.56l2.61-2.609a.75.75 0 00-1.061-1.06L8.5 5.939V.75z"/></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="M14.7 5.34C14.83 5.02 15.25 3.75 14.57 2.03C14.57 2.03 13.52 1.7 11.13 3.33C10.13 3.05 9.06 3.01 8 3.01C6.94 3.01 5.87 3.05 4.87 3.33C2.48 1.69 1.43 2.03 1.43 2.03C0.75 3.75 1.17 5.02 1.3 5.34C0.49 6.21 0 7.33 0 8.69C0 13.84 3.33 15 7.98 15C12.63 15 16 13.84 16 8.69C16 7.33 15.51 6.21 14.7 5.34ZM8 14.02C4.7 14.02 2.02 13.87 2.02 10.67C2.02 9.90997 2.4 9.18997 3.04 8.59997C4.11 7.61997 5.94 8.13997 8 8.13997C10.07 8.13997 11.88 7.61997 12.96 8.59997C13.61 9.18997 13.98 9.89997 13.98 10.67C13.98 13.86 11.3 14.02 8 14.02ZM5.49 9.01001C4.83 9.01001 4.29 9.81001 4.29 10.79C4.29 11.77 4.83 12.58 5.49 12.58C6.15 12.58 6.69 11.78 6.69 10.79C6.69 9.80001 6.15 9.01001 5.49 9.01001ZM10.51 9.01001C9.85 9.01001 9.31 9.80001 9.31 10.79C9.31 11.78 9.85 12.58 10.51 12.58C11.17 12.58 11.71 11.78 11.71 10.79C11.71 9.80001 11.18 9.01001 10.51 9.01001Z" fill="#1B1F23"/>
|
3
|
-
</svg>
|