From c0f653bbd50a01052d7f5a217c080a15561024a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27rysiek=27=20Wo=C5=BAniak?= Date: Sat, 26 Jan 2019 16:00:23 +0100 Subject: [PATCH] README: dependencies, a warning about pipes (cue Super Mario music) --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ac01e6c..7f63144 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,22 @@ A script to de-googlify CSS files, downloading relevant fonts in the process. Be ## Usage ``` -./degooglify.sh [ https://fonts.googleapis.com/css?(...) | file.css ] +./degooglify.sh [ 'https://fonts.googleapis.com/css?(...)' | file.css ] ``` +**Please note: remember to put the URL in quotes, or otherwise escape any special characters.** +Google Fonts CSS URLs contain the pipe character (`|`) which will be interpreted by your shell and cause the URL passed to `degooglify.sh` to be incomplete. + ## Operation The `degooglify.sh` script takes as arguments local files and URLs (leading to `fonts.googleapis.com`). It handles multiple arguments, including mixing of URLs and files. It then downloads the CSS files from URLs provided, and in all local and downloaded files looks for `@import` (with URL pointing to `fonts.googleapis.com`) and `src:` (with URL pointing to `fonts.gstatic.com`) statements. -For relevant `@import` statements it then: -1. downloads the CSS files, saving them locally -1. replaces the URL with the local file name generated based on the URL -1. degooglifies the downloaded file +For relevant `@import` statements it will: +1. download the CSS files, saving them locally +1. replace the URL with the local file name generated based on the URL +1. degooglify the downloaded file For relevant `src:` statements it: 1. downloads the font files into the `fonts/` subdirectory @@ -38,6 +41,16 @@ This is designed to give an informative file name, containing font families, sty For font URLs, the file names of downloaded files are generated by taking the font name from `local()` stanza in the `src:` statement, and adding the extension taken from the URL. +## Dependencies + +An attempt is made to keep dependencies down to as few as possible. Currently these are: + - Bash 3.x+ + - either `curl` or `wget` + - GNU `sed` (or any other `sed` flavor that supports: `-i`, `-e`, `-E`) + - GNU `grep` (or any other `grep` flavor that supports extended regexen) + - `tr` + - standard system utilities (`cp`, `mkdir`) + ## Bugs and feature requests Please send bug requests and feature reports to `tech(at)occrp.org`. -- 2.22.2