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"))