From c0f127bfa0062e49e69eb085932f38815d4bb74c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 23 Mar 2013 12:11:54 +0200 Subject: [PATCH] Improve README.md: * improve the CLI switches display * specify the language used in code blocks * link to /test/bench.js * break a long line --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b2ff3ac3..0b3f63c9 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,21 @@ npm install clean-css ### How to use clean-css CLI? -Clean-css accepts the following command line arguments (please make sure you use `` as the -very last argument to avoid potential issues): +Clean-css accepts the following command line arguments (please make sure +you use `` as the very last argument to avoid potential issues): ``` cleancss [options] + +-h, --help Output usage information +-v, --version Output the version number +-e, --remove-empty Remove empty declarations (e.g. a{}) +-b, --keep-line-breaks Keep line breaks +--s0 Remove all special comments (i.e. /*! special comment */) +--s1 Remove all special comments but the first one +-r, --root [root-path] Set a root path to which resolve absolute @import rules +-o, --output [output-file] Use [output-file] as output instead of STDOUT ``` -* `-h`, `--help` output usage information -* `-v`, `--version` output the version number -* `-e`, `--remove-empty` Remove empty declarations (e.g. `a{}`) -* `-b`, `--keep-line-breaks` Keep line breaks -* `--s0` Remove all special comments (i.e. `/*! special comment */`) -* `--s1` Remove all special comments but the first one -* `-r`, `--root [root-path]` Set a root path to which resolve absolute @import rules -* `-o`, `--output [output-file]` Use [output-file] as output instead of stdout #### Examples: @@ -58,19 +59,19 @@ cleancss public.css More likely you would like to concatenate a couple of files. If you are on a Unix-like system: -``` +```bash cat one.css two.css three.css | cleancss -o merged-and-minified.css ``` On Windows: -``` +```bat type one.css two.css three.css | cleancss -o merged-and-minified.css ``` Or even gzip the result at once: -``` +```bash cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz ``` @@ -95,7 +96,7 @@ Process method accepts a hash as a second parameter, i.e., First clone the source, then run: -* `npm run bench` for clean-css benchmarks (see test/bench.js for details) +* `npm run bench` for clean-css benchmarks (see [test/bench.js](/test/bench.js) for details) * `npm run check` to check JS sources with [JSHint](https://github.com/jshint/jshint/) * `npm test` for the test suite -- 2.34.1