Skip to content

Commit

Permalink
Reworked readme, changed example files to be generic
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlbarnes committed Jan 7, 2011
1 parent 261165e commit a49c6bd
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 3,192 deletions.
14 changes: 7 additions & 7 deletions readme.md
@@ -1,7 +1,7 @@
# CodeIgniter Minify

The goal of this project is to provide a simple way to minify and combine js and css files inside a CodeIgniter application. Currently other systems
exists but I wanted to the compression to be part of my build process. So on deployments I compress and minify all the js and css. Then push off to s3
exists but I wanted the compression to be part of my build process. So on deployments I compress and minify all the js and css. Then push off to s3
but this could also be useful to write them to a single file.

## Installation
Expand All @@ -15,37 +15,37 @@ Below is an overview of different usages:
Minify JS file
<pre>
$this->load->driver('minify');
$file = 'test/js/colorbox.js';
$file = 'test/js/test1.js';
echo $this->minify->js->min($file);
</pre>

Minify CSS file
<pre>
$this->load->driver('minify');
$file = 'test/css/colorbox.css';
$file = 'test/css/test1.css';
echo $this->minify->js->min($file);
</pre>

Minify and combine an array of files. Useful if you need files to be in a certain order.
<pre>
$this->load->driver('minify');
$this->minify->combine_files(array('test/css/calendar.css', 'test/css/colorbox.css');
echo $this->minify->combine_files(array('test/css/test2.css', 'test/css/test1.css'));
</pre>

Minify and save a physical file
<pre>
$this->load->driver('minify');
$file = 'test/css/colorbox.css';
$file = 'test/css/test1.css';
$contents = $this->minify->js->min($file);
$this->minify->save_file($contents, 'test/css/all.css');
</pre>

Minify an entire directory. The second param is an array of ignored files.
<pre>
$this->load->driver('minify');
$this->minify->combine_directory('test/css/, array('all.css'));
echo $this->minify->combine_directory('test/css/, array('all.css'));
</pre>

## Credits

JS-Min - https://github.com/rgrove/jsmin-php
JS-Min - (https://github.com/rgrove/jsmin-php)
220 changes: 0 additions & 220 deletions test/css/calendar.css

This file was deleted.

64 changes: 0 additions & 64 deletions test/css/colorbox.css

This file was deleted.

6 changes: 6 additions & 0 deletions test/css/test1.css
@@ -0,0 +1,6 @@
body {
font: 62.5%/100% Arial, Helvetica, Geneva, sans-serif;
}
#content {
padding: 0px;
}
2 changes: 2 additions & 0 deletions test/css/test2.css
@@ -0,0 +1,2 @@
#modal { background: #fff; margin:0; padding: 0;}
#modal form.crud label {width:50%;}

0 comments on commit a49c6bd

Please sign in to comment.