Make code snippets easier to copy (#5736)

This commit is contained in:
Eric Cornelissen 2021-05-29 19:40:37 +02:00 committed by GitHub
parent c368b14e62
commit 2f2369b2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 23 deletions

View File

@ -7,16 +7,23 @@ Simple Icons welcomes contributions and corrections. Before contributing, please
1. Fork this repository
1. (Optional) Clone the fork
```bash
# Using SSH
git clone --filter=tree:0 git@github.com:simple-icons/simple-icons.git
- Using SSH
# Using HTTPS
git clone --filter=tree:0 https://github.com/simple-icons/simple-icons.git
```shell
git clone --filter=tree:0 git@github.com:simple-icons/simple-icons.git
```
# Using GitHub CLI
gh repo clone simple-icons/simple-icons -- --filter=tree:0
```
- Using HTTPS
```shell
git clone --filter=tree:0 https://github.com/simple-icons/simple-icons.git
```
- Using GitHub CLI
```shell
gh repo clone simple-icons/simple-icons -- --filter=tree:0
```
1. Create a new branch from the latest `develop`
1. Start hacking on the new branch
@ -366,14 +373,16 @@ If you have an affiliation to the brand you contributing that allows you to spea
## Using Docker
You can build a Docker image for this project from the Dockerfile by running:
You can build a Docker image for this project which can be used as a development environment and allows you to run SVGO safely. First, build the Docker image for simple-icons (if you haven't yet):
```bash
# Build the Docker image for simple-icons (if you haven't yet)
$ docker build . -t simple-icons
```shell
docker build . -t simple-icons
```
# Start a Docker container for simple-icons and attach to it
$ docker run -it --rm --entrypoint "/bin/ash" simple-icons
Then, start a Docker container for simple-icons and attach to it:
```shell
docker run -it --rm --entrypoint "/bin/ash" simple-icons
```
---

View File

@ -43,8 +43,8 @@ These examples use the latest major version. This means you won't receive any up
The icons are also available through our npm package. To install, simply run:
```
$ npm install simple-icons
```shell
npm install simple-icons
```
The API can then be used as follows, where `[ICON SLUG]` is replaced by a [slug]:
@ -53,7 +53,7 @@ The API can then be used as follows, where `[ICON SLUG]` is replaced by a [slug]
const simpleIcons = require('simple-icons');
// Get a specific icon by its slug as:
simpleIcons.Get('[ICON SLUG]');
// simpleIcons.Get('[ICON SLUG]');
// For example:
const icon = simpleIcons.Get('simpleicons');
@ -65,7 +65,7 @@ This is useful if you are e.g. compiling your code with [webpack](https://webpac
```javascript
// Import a specific icon by its slug as:
require('simple-icons/icons/[ICON SLUG]');
// require('simple-icons/icons/[ICON SLUG]');
// For example:
const icon = require('simple-icons/icons/simpleicons');
@ -74,7 +74,6 @@ const icon = require('simple-icons/icons/simpleicons');
Either method will return an icon object:
```javascript
console.log(icon);
/*
@ -113,16 +112,16 @@ for (const title in simpleIcons) {
There are also TypeScript type definitions for the Node package. To use them, simply run:
```
$ npm install @types/simple-icons
```shell
npm install @types/simple-icons
```
### PHP Usage
The icons are also available through our Packagist package. To install, simply run:
```
$ composer require simple-icons/simple-icons
```shell
composer require simple-icons/simple-icons
```
The package can then be used as follows, where `[ICON SLUG]` is replaced by a [slug]: