Coder Social home page Coder Social logo

simple-icons-utils's Introduction

Usage

These scripts suppose that:

  • You have inkscape installed (v1.0.0 at least).
  • You are in Linux using Bash.

Install

  1. Clone this repository at simple-icons/utils. Use next command from simple-icons directory root:
git clone https://github.com/mondeja/simple-icons-utils.git utils
  1. Install SVGO globally with npm install -g svgo

Scripts

Start a review for a remote branch

bash utils/review/start-review.sh "<ICON NAME>" "<BRANCH USERNAME OWNER>" "<BRANCH NAME>"

Scale icon to 24px size and align to center

bash utils/review/inkscape-scale-align-center.sh "<ICON PATH>" "<OUTPUT PATH>" 

Open two icons for compare them manually

bash utils/review/inkscape-gui-compare.sh [-c] "<BLACK ICON PATH>" "<RED ICON PATH>"

Query icon dimensions

bash utils/review/inkscape-dimensions.sh "<ICON PATH>"

Print differences between icons

bash utils/review/diff.sh "<PREVIOUS ICON PATH>" "<NEXT ICON PATH>"

Usual workflow

Supposing that you want to review this pull (Twitter icon correction pull-requested by @service-paradis). You can follow next steps:

  1. You are in another branch (could be develop or other). Execute:
bash utils/review/start-review.sh twitter service-paradis twitter-review

This will create the directory _review/twitter/ and will place the original twitter.svg icon inside it with the name of original.svg.

  1. You should correct the size and the alignment of the icon. Manually with Inkscape the following repetitive tasks are followed: block width/height scale factor, see what is the maximum axis size (width or height), adjust that size to 24px, go to Object -> Align and distribute, and center in both axis. This can be automated by next command:
bash utils/review/inkscape-scale-align-center.sh _review/twitter/original.svg _review/twitter/autofixed.svg

A new icon will appear at _review/twitter/autofixed.svg.

  1. We can now compare the pull requested icon with the autogenerated version using GIT diffs:
bash utils/review/diff.sh _review/twitter/autofixed.svg icons/twitter.svg
  1. If the paths does not match with the new version you can review it manually. There is another script in this repository that can open both files in Inkscape, coloring one of them in red, so you don't need to prepare the review manually:
bash utils/review/inkscape-gui-compare.sh _review/twitter/autofixed.svg icons/twitter.svg

Note that this workflow can only be used for icons that must be corrected only, but updates or new icons do not follows this workflow. However, you can use some of the scripts to make easy repetitive tasks.

simple-icons-utils's People

Contributors

mondeja avatar dependabot[bot] avatar github-actions[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.