From: XhmikosR Date: Sat, 22 Dec 2012 20:37:41 +0000 (+0200) Subject: README.md and History.md improvements: X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f34f72c17726e3b3039e6c0a48842c7250627f0a;p=clean-css.git README.md and History.md improvements: * use markdown syntax in more places * add the github links to the users mentioned * remove spaces before the list marker * break very long lines * add a link to node.js * fix typo --- diff --git a/History.md b/History.md index 927aa992..1848659b 100644 --- a/History.md +++ b/History.md @@ -1,148 +1,158 @@ 0.9.1 / 2012-12-19 ================== - * Fixed issue #37 - converting 'white' and other colors in class names (reported by @malgorithms). +* Fixed issue [#37](https://github.com/GoalSmashers/clean-css/issues/37) - converting + `white` and other colors in class names (reported by [@malgorithms](https://github.com/malgorithms)). 0.9.0 / 2012-12-15 ================== - * Added stripping quotation from font names (if possible). - * Added stripping quotation from @keyframes declaration and animation/animation-name property. - * Added stripping quotations from attributes' value (e.g. [data-target='x']). - * Added better hex->name and name->hex color shortening. - * Added shortening font:(normal|bold) the same way as font-weight is. - * Refactored shorthand selectors and added (border-radius|border-style|border-color) shortening. - * Added shortening (margin|padding|border-width). - * Added removing line break after commas. - * Fixed removing whitespace inside media query definition. - * Added removing line breaks after a comma, so all declarations are one-liners now. - * Speed optimizations (~10% despite many new features). - * Added JSHint validation rules (via `make check`). +* Added stripping quotation from font names (if possible). +* Added stripping quotation from `@keyframes` declaration, `animation` and `animation-name` property. +* Added stripping quotations from attributes' value (e.g. `[data-target='x']`). +* Added better hex->name and name->hex color shortening. +* Added `font: normal` and `font: bold` shortening the same way as `font-weight` is. +* Refactored shorthand selectors and added `border-radius`, `border-style` and `border-color` shortening. +* Added `margin`, `padding` and `border-width` shortening. +* Added removing line break after commas. +* Fixed removing whitespace inside media query definition. +* Added removing line breaks after a comma, so all declarations are one-liners now. +* Speed optimizations (~10% despite many new features). +* Added [JSHint](https://github.com/jshint/jshint/) validation rules via `make check`. 0.8.3 / 2012-11-29 ================== - * Fixed hsl/hsla colors processing. +* Fixed hsl/hsla colors processing. 0.8.2 / 2012-10-31 ================== - * Fixed shortening hex colors and their relation to hashes in urls. - * Cleanup by @XhmikosR. +* Fixed shortening hex colors and their relation to hashes in URLs. +* Cleanup by [@XhmikosR](https://github.com/XhmikosR). 0.8.1 / 2012-10-28 ================== - * Added better zeros processing for rect(...) syntax (clip property). +* Added better zeros processing for `rect(...)` syntax (clip property). 0.8.0 / 2012-10-21 ================== - * Added removing urls quotation if possible. - * Rewrote breaks processing. - * Added (keepBreaks/-b) option to keep breaks in minimized file. - * Reformatted lib/clean.js so it's easier to follow the rules. - * Minimized test data is now minimized with line breaks so it's easier to compare the changes line by line. +* Added removing URLs quotation if possible. +* Rewrote breaks processing. +* Added `keepBreaks`/`-b` option to keep breaks in minimized file. +* Reformatted lib/clean.js so it's easier to follow the rules. +* Minimized test data is now minimized with line breaks so it's easier to + compare the changes line by line. 0.7.0 / 2012-10-14 ================== - * Added stripping special comments to CLI (--s0 and --s1 options). - * Added stripping special comments to programatic interface (keepSpecialComments option). +* Added stripping special comments to CLI (`--s0` and `--s1` options). +* Added stripping special comments to programmatic interface + (`keepSpecialComments` option). 0.6.0 / 2012-08-05 ================== - * Full Windows support with tests (./test.bat). +* Full Windows support with tests (./test.bat). 0.5.0 / 2012-08-02 ================== - * Made path to vows local. - * Explicit node 0.6 requirement. +* Made path to vows local. +* Explicit node 0.6 requirement. 0.4.2 / 2012-06-28 ================== - * Updated binary -v option (version). - * Updated binary to output help when no options given (but not in piped mode). - * Added binary tests. +* Updated binary `-v` option (version). +* Updated binary to output help when no options given (but not in piped mode). +* Added binary tests. 0.4.1 / 2012-06-10 ================== - * Fixed stateless mode where calling CleanCSS#process directly was giving errors (reported by @facelessuser). +* Fixed stateless mode where calling `CleanCSS#process` directly was giving + errors (reported by [@facelessuser](https://github.com/facelessuser)). 0.4.0 / 2012-06-04 ================== - * Speed improvements (up to 4x) thanks to rewrite of comments and CSS' content processing. - * Stripping empty CSS tags is now optional (see ./bin/cleancss for details). - * Improved debugging mode (see ./test/bench.js) - * Added `make bench` for a one-pass benchmark. +* Speed improvements up to 4x thanks to the rewrite of comments and CSS' content + processing. +* Stripping empty CSS tags is now optional (see ./bin/cleancss for details). +* Improved debugging mode (see ./test/bench.js) +* Added `make bench` for a one-pass benchmark. 0.3.3 / 2012-05-27 ================== - * Fixed tests, package.json for development, and regex for removing empty declarations (thanks to @vvo). +* Fixed tests, package.json for development, and regex for removing empty + declarations (thanks to [@vvo](https://github.com/vvo)). 0.3.2 / 2012-01-17 ================== - * Fixed output method under node 0.6 which incorrectly tried to close process.stdout. +* Fixed output method under node 0.6 which incorrectly tried to close + `process.stdout`. 0.3.1 / 2011-12-16 ================== - * Fixed cleaning up '0 0 0 0' expressions. +* Fixed cleaning up `0 0 0 0` expressions. 0.3.0 / 2011-11-29 ================== - * Clean-css requires node 0.4.0+ to run. - * Removed node's 0.2.x 'sys' package dependency (thanks to @jmalonzo for a patch). +* Clean-css requires node 0.4.0+ to run. +* Removed node's 0.2.x 'sys' package dependency + (thanks to [@jmalonzo](https://github.com/jmalonzo) for a patch). 0.2.6 / 2011-11-27 ================== - * Fixed expanding + signs in calc() when mixed up with adjacent (+) selector. +* Fixed expanding `+` signs in `calc()` when mixed up with adjacent `+` selector. 0.2.5 / 2011-11-27 ================== - * Fixed issue with cleaning up spaces inside calc/-moz-calc declarations (thanks to @cvan for reporting it). - * Fixed converting #f00 to red in borders and gradients. +* Fixed issue with cleaning up spaces inside `calc`/`-moz-calc` declarations + (thanks to [@cvan](https://github.com/cvan) for reporting it). +* Fixed converting `#f00` to `red` in borders and gradients. 0.2.4 / 2011-05-25 ================== - * Fixed problem with expanding 'none' to '0' in partial/full background declarations. - * Fixed including clean-css library from binary (global to local). +* Fixed problem with expanding `none` to `0` in partial/full background + declarations. +* Fixed including clean-css library from binary (global to local). 0.2.3 / 2011-04-18 ================== - * Fixed problem with optimizing IE filters. +* Fixed problem with optimizing IE filters. 0.2.2 / 2011-04-17 ================== - * Fixed problem with space before color in 'border' property. +* Fixed problem with space before color in `border` property. 0.2.1 / 2011-03-19 ================== - * Added stripping space before !important keyword. - * Updated repository location and author information in package.json. +* Added stripping space before `!important` keyword. +* Updated repository location and author information in package.json. 0.2.0 / 2011-03-02 ================== - * Added options parsing via optimist. - * Changed code inclusion (thus version bump). +* Added options parsing via optimist. +* Changed code inclusion (thus the version bump). 0.1.0 / 2011-02-27 ================== - * First version of clean-css library. - * Implemented all basic CSS transformations. \ No newline at end of file +* First version of clean-css library. +* Implemented all basic CSS transformations. diff --git a/README.md b/README.md index e3c7c2a9..72d7085a 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,92 @@ [![build status](https://secure.travis-ci.org/GoalSmashers/clean-css.png)](http://travis-ci.org/GoalSmashers/clean-css) ## What is clean-css? ## -Clean-css is a node.js library for minifying CSS files. It does the same job as YUI Compressor's CSS minifier but much faster thanks to many speed optimizations and the node.js' V8 engine. +Clean-css is a [node.js](http://nodejs.org/) library for minifying CSS files. +It does the same job as YUI Compressor's CSS minifier, but much faster thanks +to many speed optimizations and node.js' V8 engine. ## Usage ## ### What are the requirements? ### - node 0.6.0+ on *nix (fully tested on OS X 10.6+ and CentOS) - node 0.8.0+ on Windows +``` +node 0.6.0+ on *nix (fully tested on OS X 10.6+ and CentOS) +node 0.8.0+ on Windows +``` ### How to install clean-css? ### - npm install clean-css +`npm install clean-css` ### How to use clean-css CLI? ### To minify a **public.css** file into **public-min.css** do: - cleancss -o public-min.css public.css +`cleancss -o public-min.css public.css` -To minify the same **public.css** into the standard output skip the -o parameter: +To minify the same **public.css** into the standard output skip the `-o` parameter: - cleancss public.css +`cleancss public.css` -More likely you would like to concatenate couple files like this (if you are on *nix system): +More likely you would like to concatenate a couple of files. Iif you are on a *nix system: - cat one.css two.css three.css | cleancss -o merged-and-minified.css +`cat one.css two.css three.css | cleancss -o merged-and-minified.css` or on Windows: - type one.css two.css three.css | cleancss -o merged-and-minified.css +`type one.css two.css three.css | cleancss -o merged-and-minified.css` Or even gzip the result at once: - cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz +`cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz` ### How to use clean-css programmatically? ### ```javascript - var cleanCSS = require('clean-css'); - var source = "a{font-weight:bold;}"; - var minimized = cleanCSS.process(source); +var cleanCSS = require('clean-css'); +var source = "a{font-weight:bold;}"; +var minimized = cleanCSS.process(source); ``` -Process method accepts a hash as a second parameter (i.e. `cleanCSS.process(source, options)`), with the following options available: +Process method accepts a hash as a second parameter, i.e., `cleanCSS.process(source, options)` +with the following options available: * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one, `0` for removing all * `keepBreaks` - whether to keep line breaks (default is false) * `removeEmpty` - whether to remove empty elements (default is false) -* `debug` - turns on debug mode (measuring time spent on cleaning up - run `npm run bench` to see example) +* `debug` - turns on debug mode measuring time spent on cleaning up (run `npm run bench` to see example) ### What are the clean-css' dev commands? ### First clone the source, then run: -* `npm run bench` for clean-css benchmarks (see test/bench,js for details) -* `npm run check` to check JS sources with JSHint +* `npm run bench` for clean-css benchmarks (see 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 ### How do you preserve a comment block? ### -Use `/*!` notation instead of standard one (i.e. `/*`): +Use the `/*!` notation instead of the standard one `/*`: - /*! - Important comments included in minified output. - */ +```css +/*! + Important comments included in minified output. +*/ +``` ## Acknowledgments ## -* Vincent Voyer (@vvo) for a patch with better empty element regex and for inspiring us to do many performance improvements in 0.4 release. -* Isaac (@facelessuser) for pointing out a flaw in clean-css' stateless mode. -* Jan Michael Alonzo (@jmalonzo) for a patch removing node's old 'sys' package. -* @XhmikosR for suggesting new features (option to remove special comments and strip out urls quotation) and pointing out numerous improvements (JSHint, media queries). +* Vincent Voyer ([@vvo](https://github.com/vvo)) for a patch with better + empty element regex and for inspiring us to do many performance improvements + in 0.4 release. +* Isaac ([@facelessuser](https://github.com/facelessuser)) for pointing out + a flaw in clean-css' stateless mode. +* Jan Michael Alonzo ([@jmalonzo](https://github.com/jmalonzo)) for a patch + removing node's old 'sys' package. +* [@XhmikosR](https://github.com/XhmikosR) for suggesting new features + (option to remove special comments and strip out URLs quotation) and pointing + out numerous improvements (JSHint, media queries). ## License ##