README.chromium
1 Name: rCSSmin
2 Short Name: rcssmin
3 URL: http://opensource.perlig.de/rcssmin/
4 Version: 1.0.5
5 License: Apache 2.0
6 License File: NOT_SHIPPED
7 Security Critical: no
8
9 Description:
10 rCSSmin is a CSS minifier written in python.
11 The minifier is based on the semantics of the YUI compressor, which itself is
12 based on the rule list by Isaac Schlueter.
13
14 Modifications made:
15 - Removed the bench.sh since the file doesn't have the licensing info and
16 caused license checker to fail.
17
README.rst
1 .. -*- coding: utf-8 -*-
2
3 =====================================
4 rCSSmin - A CSS Minifier For Python
5 =====================================
6
7 TABLE OF CONTENTS
8 -----------------
9
10 1. Introduction
11 2. Copyright and License
12 3. System Requirements
13 4. Installation
14 5. Documentation
15 6. Bugs
16 7. Author Information
17
18
19 INTRODUCTION
20 ------------
21
22 RCSSmin is a CSS minifier written in python.
23
24 The minifier is based on the semantics of the `YUI compressor`_\, which itself
25 is based on `the rule list by Isaac Schlueter`_\.
26
27 This module is a re-implementation aiming for speed instead of maximum
28 compression, so it can be used at runtime (rather than during a preprocessing
29 step). RCSSmin does syntactical compression only (removing spaces, comments
30 and possibly semicolons). It does not provide semantic compression (like
31 removing empty blocks, collapsing redundant properties etc). It does, however,
32 support various CSS hacks (by keeping them working as intended).
33
34 Here's a feature list:
35
36 - Strings are kept, except that escaped newlines are stripped
37 - Space/Comments before the very end or before various characters are
38 stripped: ``:{});=>+],!`` (The colon (``:``) is a special case, a single
39 space is kept if it's outside a ruleset.)
40 - Space/Comments at the very beginning or after various characters are
41 stripped: ``{}(=:>+[,!``
42 - Optional space after unicode escapes is kept, resp. replaced by a simple
43 space
44 - whitespaces inside ``url()`` definitions are stripped
45 - Comments starting with an exclamation mark (``!``) can be kept optionally.
46 - All other comments and/or whitespace characters are replaced by a single
47 space.
48 - Multiple consecutive semicolons are reduced to one
49 - The last semicolon within a ruleset is stripped
50 - CSS Hacks supported:
51
52 - IE7 hack (``>/**/``)
53 - Mac-IE5 hack (``/*\*/.../**/``)
54 - The boxmodelhack is supported naturally because it relies on valid CSS2
55 strings
56 - Between ``:first-line`` and the following comma or curly brace a space is
57 inserted. (apparently it's needed for IE6)
58 - Same for ``:first-letter``
59
60 rcssmin.c is a reimplementation of rcssmin.py in C and improves runtime up to
61 factor 100 or so (depending on the input). docs/BENCHMARKS in the source
62 distribution contains the details.
63
64 .. _YUI compressor: https://github.com/yui/yuicompressor/
65
66 .. _the rule list by Isaac Schlueter: https://github.com/isaacs/cssmin/
67
68
69 COPYRIGHT AND LICENSE
70 ---------------------
71
72 Copyright 2011 - 2014
73 Andr Malo or his licensors, as applicable.
74
75 The whole package (except for the files in the bench/ directory)
76 is distributed under the Apache License Version 2.0. You'll find a copy in the
77 root directory of the distribution or online at:
78 <http://www.apache.org/licenses/LICENSE-2.0>.
79
80
81 SYSTEM REQUIREMENTS
82 -------------------
83
84 Both python 2 (>=2.4) and python 3 are supported.
85
86
87 INSTALLATION
88 ------------
89
90 Using pip
91 ~~~~~~~~~
92
93 $ pip install rcssmin
94
95
96 Using distutils
97 ~~~~~~~~~~~~~~~
98
99 $ python setup.py install
100
101 The following extra options to the install command may be of interest:
102
103 --without-c-extensions Don't install C extensions
104 --without-docs Do not install documentation files
105
106
107 Drop-in
108 ~~~~~~~
109
110 rCSSmin effectively consists of two files: rcssmin.py and rcssmin.c, the
111 latter being entirely optional. So, for simple integration you can just
112 copy rcssmin.py into your project and use it.
113
114
115 DOCUMENTATION
116 -------------
117
118 A generated API documentation is available in the docs/apidoc/ directory.
119 But you can just look into the module. It provides a simple function,
120 called cssmin which takes the CSS as a string and returns the minified
121 CSS as a string.
122
123 The module additionally provides a "streamy" interface:
124
125 $ python -mrcssmin <css >minified
126
127 It takes two options:
128
129 -b Keep bang-comments (Comments starting with an exclamation mark)
130 -p Force using the python implementation (not the C implementation)
131
132 The latest documentation is also available online at
133 <http://opensource.perlig.de/rcssmin/>.
134
135
136 BUGS
137 ----
138
139 No bugs, of course. ;-)
140 But if you've found one or have an idea how to improve rcssmin, feel free to
141 send a pull request on `github <https://github.com/ndparker/rcssmin>`_ or
142 send a mail to <rcssmin-bugs (a] perlig.de>.
143
144
145 AUTHOR INFORMATION
146 ------------------
147
148 Andr "nd" Malo <nd (a] perlig.de>
149 GPG: 0x8103A37E
150
151
152 If God intended people to be naked, they would be born that way.
153 -- Oscar Wilde
154