From b8ae8518fe0664722c9f4d1d3a37bb07203c8a5d Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Fri, 5 Jun 2020 00:40:10 +0100 Subject: [PATCH] Add contribution instructions --- README.md | 26 +++++++++++++++++++++----- compress.py | 18 ------------------ 2 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 compress.py diff --git a/README.md b/README.md index 8760e31..0e214c8 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ https://hatscripts.github.io/circle-flags/flags/xx.svg ``` (Where `xx` is the [ISO 3166-1 alpha-2 code](https://www.iso.org/obp/ui/#search/code/) of a country). -For example: - +For example, the following code: ```html @@ -21,9 +20,7 @@ For example: ``` -Gives: - -\ +...produces this:

@@ -31,3 +28,22 @@ Gives: + +## Contributing + +To contribute, you need to have [svgo](https://github.com/svg/svgo) installed +(version 1.2.0 or newer). + +First, edit the relevant SVG files in the `flags/` directory. + +Then run `svgo` to optimize the SVG files: + +```sh +svgo ./flags --recursive +``` + +Then commit the changes, and submit them as a pull request. + +## License + +This project is released under the [MIT license](LICENSE). diff --git a/compress.py b/compress.py deleted file mode 100644 index fa257d8..0000000 --- a/compress.py +++ /dev/null @@ -1,18 +0,0 @@ -import shutil -from pathlib import Path -from subprocess import run - -# Compress all SVG files in a directory, recursively entering subdirectories. -# This solution is necessary because SVGO lacks support for a '--recursive' option -# (https://github.com/svg/svgo/pull/712), and other workarounds are platform-dependant. - -svgo = shutil.which("svgo") # https://stackoverflow.com/a/32799942/2203482 - -def compress(path): - # Calling "svgo -f " is much faster than calling "svgo " for each SVG - run([svgo, "-f", str(path), "--config=svgo.yml"]) - for path in path.iterdir(): - if path.is_dir(): - compress(path) - -compress(Path("flags"))