Commit 9799dba7 authored by Hideki Yamane's avatar Hideki Yamane 🐈

Merge tag 'v8.1.0' into debian/sid

parents 33ff7f05 cad47f96
The contents of */octicons* */svg* are generated by an automated process. Changes to these files may be accepted, but may also be overwritten.
# Adding or Updating icons
Octicons is GitHub's icon font. At this time, new icons will only be added when they are needed for GitHub products.
If you plan to update an icon and/or add a new icon follow these steps. These steps will be the same for core primer members and contributors.
Complete steps 1 - 3 and notify us of your changes, either with a pull request or an issue describing your changes. Screenshots welcome! 🎉
## Step 1, Duplicate:
The first step is to make a copy of the [master Octicons file][master-octicons] to your drafts folder. You can do this from the dropdown menu, select "Duplicate to your drafts".
[<img src="https://user-images.githubusercontent.com/54012/37802948-c10dca06-2de9-11e8-98c3-dd45cd561865.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37802948-c10dca06-2de9-11e8-98c3-dd45cd561865.gif)
## Step 2, Edit:
In your duplicate file, make proposed changes. In the example, we’ll make the GitHub logo red. It will also simplify things if you give your file a unique name e.g. _Octicons (Jon’s Changes)_.
[<img src="https://user-images.githubusercontent.com/54012/37803022-14d1a0fe-2dea-11e8-862d-b7ef22c918cf.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37803022-14d1a0fe-2dea-11e8-862d-b7ef22c918cf.gif)
## Step 3, Share:
Make sure your duplicate file can be viewed by others. In the share menu "Anyone with link" should be set to "can view". Copy the link.
[<img src="https://user-images.githubusercontent.com/54012/37803059-3ca54432-2dea-11e8-8c27-36c83a2dc5cb.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37803059-3ca54432-2dea-11e8-8c27-36c83a2dc5cb.gif)
## Step 4, Pull Request: _(Optional)_
You can submit a pull request updating the `figma.url` configuration in the root [package.json](https://github.com/primer/octicons/blob/master/package.json#L10) with your figma file. Doing so will generate alpha releases of [all the libraries that distribute Octicons](https://github.com/primer/octicons#libraries).
Once the build passes on your pull request, you should see statuses with all the alpha versions of the libraries. You can then use these to test your changes.
[Here is an example pull request](https://github.com/primer/octicons/pull/206)
[<img src="https://user-images.githubusercontent.com/54012/37811102-45ec2abc-2e15-11e8-8c1d-2d162ddcdad2.png" width="700"/>](https://user-images.githubusercontent.com/54012/37811102-45ec2abc-2e15-11e8-8c1d-2d162ddcdad2.png)
---
# Maintainers accepting changes
Once submitted changes have been agreed upon, these instructions will guide core primer team members in merging in those changes.
## Step 1, Save:
Save the contributor’s figma file as a `.fig` file.
[<img src="https://user-images.githubusercontent.com/54012/37809888-940f5d38-2e0e-11e8-957f-99c162a1d4ff.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37809888-940f5d38-2e0e-11e8-957f-99c162a1d4ff.gif)
## Step 2, Import:
Drag and drop, or add the file to the main team project. Make sure its name is different from the master Octicons file.
[<img src="https://user-images.githubusercontent.com/54012/37809879-8d9824ee-2e0e-11e8-9b1d-e83316192eb0.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37809879-8d9824ee-2e0e-11e8-9b1d-e83316192eb0.gif)
## Step 3, Publish:
From the new imported file, publish the updated or new components to the team library. This published component makes importing into the master document easier.
[<img src="https://user-images.githubusercontent.com/54012/37807772-6734f926-2e04-11e8-98a0-9b4c73411bd3.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37807772-6734f926-2e04-11e8-98a0-9b4c73411bd3.gif)
## Step 4, Add:
In the Team Library you will see the new Octicons file, and all the components from that file. Add the new components to the master Octicons file. It makes changing easier if you drag it on top of the icon you are changing.
[<img src="https://user-images.githubusercontent.com/54012/37807775-6b1dea52-2e04-11e8-804a-a41c6bc04fd2.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37807775-6b1dea52-2e04-11e8-804a-a41c6bc04fd2.gif)
## Step 5, Replace:
Right click on the new component instance and select "Detach Instance". Then toggle both the old and new components open. Move the shape from the new component into the old component. Delete the old component’s shape. Delete the empty new component container.
[<img src="https://user-images.githubusercontent.com/54012/37807780-6ddba626-2e04-11e8-9a6b-749ac5b800fe.gif" width="400"/>](https://user-images.githubusercontent.com/54012/37807780-6ddba626-2e04-11e8-9a6b-749ac5b800fe.gif)
## Step 6, Publishing:
Publish the component changes to your team library. You can now delete the imported `.fig` file from the contributor.
[<img src="https://user-images.githubusercontent.com/54012/37812350-cc2349ba-2e1c-11e8-8b80-d9ff2f8d4ea3.png" width="600"/>](https://user-images.githubusercontent.com/54012/37812350-cc2349ba-2e1c-11e8-8b80-d9ff2f8d4ea3.png)
Create a release branch, and run `npm run bump`. This will guide you through a prompt asking what all the new versions of the packages should be. After, push up your branch and open a pull request into master.
[master-octicons]: https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons
node_modules
.DS_Store
build
*.gem
*.lock
*.log
.DS_Store
.bundle
.env
node_modules
package-lock.json
vendor
# Ignore build/export artifacts
lib/**/build/
.github
.travis.yml
Gruntfile.js
lib
test
inherit_gem:
rubocop-github:
- config/default.yml
- config/rails.yml
multipass: true
plugins:
- removeTitle: true
- removeViewBox: false
- removeStyleElement: true
- removeAttrs:
attrs:
- xmlns:xlink
- id
- class
- data-name
- fill
- transform
- href
- clip-path
- clip-rule
- removeEmptyContainers: true
- sortAttrs: true
- removeUselessDefs: true
- removeEmptyText: true
- removeEditorsNSData: true
- removeEmptyAttrs: true
- removeHiddenElems: true
- collapseGroups: true
language: node_js
node_js:
- '5'
- 8
script:
- npm test
after_success:
# Setup rubygems creds
- curl -u "$RUBYGEMS_USER:$RUBYGEMS_PW" https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
- chmod 0600 ~/.gem/credentials
# this will short-circuit the publish step if it fails to interpolate $NPM_API_KEY
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}"
deploy:
# publish release candidates from any branch beginning with "release"
- on:
condition: $TRAVIS_BRANCH =~ ^release
all_branches: true
tags: false
provider: script
script:
- script/release-candidate
skip_cleanup: true
# publish "final" releases on master
- on:
branch: master
tags: false
provider: script
script: script/release
skip_cleanup: true
notifications:
slack: 'github:4OisIoqZYyMlWcw3hFtZgbmh'
### HEAD
# 7.3.0
* Fix for heart icon https://github.com/primer/octicons/pull/211
* Adding an archive icon created by @colinkeany
Fixes https://github.com/primer/octicons/issues/182
* Fixed versioning strategy https://github.com/primer/octicons/pull/#208
# Archived releases
### Octicons_node 7.0.0
- Removing `file-text` and `mail-reply` icons. Use `file` and `reply` respectively.
- Removing spritesheet calls and `toSVGUse` method.
### Octicons_gem 5.0.4
- Removing `file-text` and `mail-reply` icons. Use `file` and `reply` respectively.
- Removing spritesheet calls and `to_svg_use` method.
### 6.0.1
Fixes:
- Typo `kebab-veritcal` becomes `kebab-vertical`
### 6.0.0
Added:
- `kebab-horizontal` and `kebab-vertical` icons
- Polyfill for the `Object.assign` function
Removes:
- Removing a duplicate `ellipses` icon from the set. Use `ellipsis` instead.
### 5.0.1
......
var fs = require("fs")
var path = require("path")
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssnano: {
options: {},
dist: {
files: {
'build/octicons.min.css': 'build/octicons.css'
}
}
},
svgmin: {
dist: {
options: {
plugins: [
{removeTitle: true},
{removeStyleElement: true},
{removeAttrs: { attrs: ['id', 'class', 'data-name', 'fill'] }},
{removeEmptyContainers: true},
{sortAttrs: true},
{removeUselessDefs: true},
{removeEmptyText: true},
{removeEditorsNSData: true},
{removeEmptyAttrs: true},
{removeHiddenElems: true}
]
},
files: [{
expand: true,
cwd: 'lib/svg',
src: ['*.svg'],
dest: 'build/svg'
}]
}
},
svgstore: {
options: {
includeTitleElement: false,
inheritviewbox: true,
includedemo: function(arg) {
var octicons = require("./index.js")
var icons = function() {
var result = []
Object.keys(octicons).forEach(function(key){
result.push("<div style=\"width: 10%;min-width: 100px;flex: 0 0 auto;box-sizing:border-box;padding:1em;text-align:center;\">" + octicons[key].toSVGUse({ height: 32 }) + "<div>" + key + "</div></div>")
})
return result.join("\n")
}
return `
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Octicons Spritesheet test</title>
<link rel="stylesheet" href="./octicons.css" media="screen" title="no title">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
color: #222;
font-size: 15px;
}
</style>
</head>
<body>
${arg.svg}
<div style="font-size: 2.2em;padding-left: 20px;">Octicons SVG Spritesheet demo</div>
<div style="font-size: 1.2em;margin: 1em 0;padding-left: 20px;">All the icons rendered below use the svg spriteheet located in the <code>/build/</code> directory.</div>
<div style="flex: 0 1 auto;display:flex;flex-wrap: wrap; flex-direction: row;">
${icons()}
</div>
</body>
</html>
`
}
},
default: {
files: {
"build/sprite.octicons.svg": ['build/svg/*.svg']
}
},
},
clean: {
build: [
'build/*'
]
},
copy: {
css: {
src: "lib/octicons.css",
dest: "build/octicons.css"
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-svgstore');
grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-cssnano');
// build tasks
grunt.registerTask('css', ['copy', 'cssnano']);
grunt.registerTask('svg', ['clean', 'svgmin']);
// default task, build /dist/
grunt.registerTask('default', [ 'svg', 'css', 'json:svg', 'svgstore']);
grunt.registerTask('json:svg', 'add svg string to data.json build', function() {
var files = fs.readdirSync("./build/svg/")
var data = JSON.parse(fs.readFileSync("./lib/data.json"))
files.forEach(function(file) {
var svg = fs.readFileSync(path.resolve("./build/svg", file))
var key = path.basename(file, ".svg")
if (data[key]) {
var raw = svg.toString()
data[key].path = /<path.+\/>/g.exec(raw)[0]
data[key].height = /height="(\d+)"/g.exec(raw)[1]
data[key].width = /width="(\d+)"/g.exec(raw)[1]
}
})
fs.writeFileSync("build/data.json", JSON.stringify(data));
})
};
MIT License
Copyright (c) 2012-2016 GitHub, Inc.
Copyright (c) 2018 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
# GitHub Octicons
# Octicons
[![NPM version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons)
[![Build Status](https://travis-ci.org/primer/octicons.svg?branch=master)](https://travis-ci.org/primer/octicons)
> Octicons are a scalable set of icons handcrafted with <3 by GitHub.
## Install
**NOTE:** The compiled files are located in `/build/`. This directory is located in the published npm package. Which means you can access it when you `npm install octicons`. You can also build this directory by following the [building octicons directions](#building-octicons). The files in the `/lib/` directory are the raw source files and are not compiled or optimized.
#### NPM
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `octicons` with this command.
```
$ npm install --save octicons
```
## Usage
For all the usages, we recommend using the CSS located in `./build/octicons.css`. This is some simple CSS to normalize the icons and inherit colors.
### Spritesheet
With a [SVG sprite icon system](https://css-tricks.com/svg-sprites-use-better-icon-fonts/) you can include the sprite sheet located `./build/sprite.octicons.svg` after you [build the icons](#building-octicons) or from the npm package. There is a demo of how to use the spritesheet in the build directory also.
### Node
After installing `npm install octicons` you can access the icons like this.
```js
var octicons = require("octicons")
octicons.alert
// { keywords: [ 'warning', 'triangle', 'exclamation', 'point' ],
// path: '<path d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/>',
// height: '16',
// width: '16',
// symbol: 'alert',
// options:
// { version: '1.1',
// width: '16',
// height: '16',
// viewBox: '0 0 16 16',
// class: 'octicon octicon-alert',
// 'aria-hidden': 'true' },
// toSVG: [Function] }
```
There will be a key for every icon, with `keywords` and `svg`.
#### `octicons.alert.symbol`
Returns the string of the symbol name
```js
octicons.x.symbol
// "x"
```
#### `octicons.person.path`
Path returns the string representation of the path of the icon.
```js
octicons.x.path
// <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>
```
#### `octicons.issue.options`
This is a json object of all the `options` that will be added to the output tag.
```js
octicons.x.options
// { version: '1.1', width: '12', height: '16', viewBox: '0 0 12 16', class: 'octicon octicon-x', 'aria-hidden': 'true' }
```
#### `octicons.alert.width`
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_
[![octicons](https://user-images.githubusercontent.com/54012/37737576-5d1e8c7a-2d11-11e8-8fd9-13956a241549.png)][figma-file]
#### `octicons.alert.height`
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_
#### `keywords`
Returns an array of keywords for the icon. The data [comes from the octicons repository](https://github.com/primer/octicons/blob/master/lib/data.json). Consider contributing more aliases for the icons.
```js
octicons.x.keywords
// ["remove", "close", "delete"]
```
#### `octicons.alert.toSVG()`
Returns a string of the svg tag
```js
octicons.x.toSVG()
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" 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"/></svg>
```
The `.toSVG()` method accepts an optional `options` object. This is used to add CSS classnames, a11y options, and sizing.
##### class
Add more CSS classes to the `<svg>` tag.
```js
octicons.x.toSVG({ "class": "close" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x close" 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"/></svg>
```
##### aria-label
[![Build Status](https://travis-ci.org/primer/octicons.svg?branch=master)](https://travis-ci.org/primer/octicons)
Add accessibility `aria-label` to the icon.
Octicons are a set of SVG icons built by GitHub for GitHub. This repository is a mono repository that contains [distribution libraries for other platforms/languages](#libraries). The vectors for all the icons are stored in a [Figma file][figma-file].
```js
octicons.x.toSVG({ "aria-label": "Close the window" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-label="Close the window" role="img"><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"/></svg>
```
## Adding/Updating an icon
##### width & height
Read through our [contributing guide](./.github/CONTRIBUTING.md#adding-or-updating-icons) if you're planning on adding or updating one of the icons.
Size the SVG icon larger using `width` & `height` independently or together.
## Libraries
```js
octicons.x.toSVG({ "width": 45 })
// <svg version="1.1" width="45" height="60" viewBox="0 0 12 16" class="octicon octicon-x" 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"/></svg>
```
This repository is a repository containing other packages. Each of them is in the `lib/` folder and gives access to Octicons on a different platform / language.
#### `octicons.alert.toSVGUse()`
### JavaScript
Returns a string of the svg tag with the `<use>` tag, for use with the spritesheet located in the /build/ directory.
The octicons node.js library is the main JavaScript library. With [a JavaScript API](/lib/octicons_node/README.md) that can be used in a variety of applications.
```js
octicons.x.toSVGUse()
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-hidden="true"><use xlink:href="#x" /></svg>
```
| Package | Version |
|---|---|
| **[octicons](/lib/octicons_node)** <br />Node.js package with Javascript API | [![npm version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons) |
| **[@githubprimer/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](https://img.shields.io/npm/v/@githubprimer/octicons-react.svg)](https://www.npmjs.org/package/@githubprimer/octicons-react) |
### Ruby
If your environment is Ruby on Rails, we have a [octicons_helper](https://github.com/primer/octicons_helper) gem available that renders SVG in your page. The octicons_helper uses the [octicons_gem](https://github.com/primer/octicons_gem) to do the computing and reading of the SVG files.
### Jekyll
For jekyll, there's a [jekyll-octicons](https://github.com/primer/jekyll-octicons) plugin available. This works exactly like the octicons_helper.
## Changing, adding, or deleting icons
1. Open the [Sketch document][sketch-document] in `/lib/`. Each icon exists as an artboard within our master Sketch document. If you’re adding an icon, duplicate one of the artboards and add your shapes to it. Be sure to give your artboard a name that makes sense.
2. Once you’re happy with your icon set, choose File > Export…
3. Choose all the artboards you’d like to export and then press “Export”
4. Export to `/lib/svg/`
You’ll next need to build your Octicons.
## Building Octicons
All the files you need will be in the `/build/` directory already, but if you’ve made changes to the `/lib/` directory and need to regenerate, follow these steps:
1. Open the Octicons directory in Terminal
2. `npm install` to install all dependencies for the project.
3. Run the command `npm run build`. This will run the grunt task to build the SVGs, placing them in the `/build/` directory.
## Publishing
If you have access to publish this repository, these are the steps to publishing. If you need access, contact [#design-systems](https://github.slack.com/archives/design-systems).
1. Update the [CHANGELOG.md](./CHANGELOG.md) with relevant version number and any updates made to the repository.
2. `npm version <newversion>` Run [npm version](https://docs.npmjs.com/cli/version) inputing the relevant version type. The versioning is [semver](http://semver.org/), so version appropriately based on what has changed.
3. `npm publish` This will publish the new version to npmjs.org
4. `git push && git push --tags` Push all these changes to origin.
| Package | Version |
|---|---|
| **[octicons](/lib/octicons_gem)** <br />Ruby gem with Ruby API | [![Gem version](https://img.shields.io/gem/v/octicons.svg)](https://rubygems.org/gems/octicons) |
| [octicons_helper](/lib/octicons_helper)<br />Rails helper for using octicons| [![Gem version](https://img.shields.io/gem/v/octicons_helper.svg)](https://rubygems.org/gems/octicons_helper) |
| [jekyll-octicons](/lib/octicons_jekyll)<br />Jekyll plugin for using octicons | [![Gem version](https://img.shields.io/gem/v/jekyll-octicons.svg)](https://rubygems.org/gems/jekyll-octicons) |
## License
(c) 2012-2016 GitHub, Inc.
(c) GitHub, Inc.
When using the GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).
_SVG License:_ [SIL OFL 1.1](http://scripts.sil.org/OFL)
Applies to all SVG files
_Code License:_ [MIT](./LICENSE)
Applies to all other files
[primer]: https://github.com/primer/primer
[docs]: http://primercss.io/
[npm]: https://www.npmjs.com/
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
[sass]: http://sass-lang.com/
[sketch-document]: https://github.com/primer/octicons/blob/master/lib/octicons-master.sketch
[figma-file]: https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons
[octicons_gem]:
[octicons_node]:
[octicons_helper]:
[octicons_jekyll]:
{
"lerna": "2.9.0",
"packages": [
"lib/octicons_node",
"lib/octicons_gem",
"lib/octicons_helper",
"lib/octicons_jekyll",
"lib/octicons_react"
],
"version": "8.1.0"
}
{
"alert": {
"keywords": [
"warning",
"triangle",
"exclamation",
"point"
]
},
"arrow-down": {
"keywords": [
"point",
"direction"
]
},
"arrow-left": {
"keywords": [
"point",
"direction"
]
},
"arrow-right": {
"keywords": [
"point",
"direction"
]
},
"arrow-small-down": {
"keywords": [
"point",
"direction"
]
},
"arrow-small-left": {
"keywords": [
"point",
"direction",
"little",
"tiny"
]
},
"arrow-small-right": {
"keywords": [
"point",
"direction",
"little",
"tiny"