Skip to content

Commit 10cda4b

Browse files
committed
bump semver to 0.1.0; update docs
1 parent e4bc37b commit 10cda4b

File tree

12 files changed

+83
-44
lines changed

12 files changed

+83
-44
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ php:
77
# - hhvm
88

99
script:
10-
- composer install --dev
1110
- phpunit tests

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ GPL VERSION 3
3838

3939

4040

41-
GNU GENERAL PUBLIC LICENSE
41+
GNU GENERAL PUBLIC LICENSE
4242
Version 3, 29 June 2007
4343

4444
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# scssphp v0.0.15
1+
# scssphp v0.1.0
22
### <http://leafo.net/scssphp>
33

44
[![Build Status](https://secure.travis-ci.org/leafo/scssphp.png)](http://travis-ci.org/leafo/scssphp)

bin/pscss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
error_reporting(E_ALL);
55

6-
require __DIR__ . '/../vendor/autoload.php';
6+
include 'scss.inc.php';
77

88
use Leafo\ScssPhp\Compiler;
99
use Leafo\ScssPhp\Parser;

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "leafo/scssphp",
33
"type": "library",
44
"description": "scssphp is a compiler for SCSS written in PHP.",
5+
"keywords": ["css", "stylesheet", "scss", "sass", "less"],
56
"homepage": "http://leafo.net/scssphp/",
67
"license": [
78
"MIT",

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
processIsolation = "false"
1313
stopOnFailure = "false"
1414
syntaxCheck = "false"
15-
bootstrap = "vendor/autoload.php">
15+
bootstrap = "scss.inc.php">
1616

1717
<testsuites>
1818
<testsuite name="Project Test Suite">
@@ -22,7 +22,7 @@
2222

2323
<filter>
2424
<whitelist>
25-
<directory>.</directory>
25+
<directory>src</directory>
2626
</whitelist>
2727
</filter>
2828

scss.inc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
include __DIR__ . '/src/Colors.php';
3+
include __DIR__ . '/src/Compiler.php';
4+
include __DIR__ . '/src/Formatter.php';
5+
include __DIR__ . '/src/Formatter/Compressed.php';
6+
include __DIR__ . '/src/Formatter/Crunched.php';
7+
include __DIR__ . '/src/Formatter/Expanded.php';
8+
include __DIR__ . '/src/Formatter/Nested.php';
9+
include __DIR__ . '/src/Parser.php';
10+
include __DIR__ . '/src/Server.php';

site/docs/index.md

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
### Including
1111

12-
The entire project comes in a single file. Just include it somewhere to start
13-
using it:
12+
The project can be loaded through a `composer` generated auto-loader.
13+
14+
Alternatively, the entire project can be loaded through a utility file.
15+
Just include it somewhere to start using it:
1416

1517
```php
1618
<?php
@@ -20,13 +22,16 @@ using it:
2022
### Compiling
2123

2224
In order to manually compile code from PHP you must create an instance of the
23-
`scssc` class. The typical flow is to create the instance, set any compile time
25+
`Compiler` class. The typical flow is to create the instance, set any compile time
2426
options, then run the compiler with the `compile` method.
2527

2628
```php
2729
<?php
2830
require "scssphp/scss.inc.php";
29-
$scss = new scssc();
31+
32+
use Leafo\ScssPhp\Compiler;
33+
34+
$scss = new Compiler();
3035

3136
echo $scss->compile('
3237
$color: #abc;
@@ -59,7 +64,10 @@ The default import path is `array("")`, which means the current directory.
5964
```php
6065
<?php
6166
require "scssphp/scss.inc.php";
62-
$scss = new scssc();
67+
68+
use Leafo\ScssPhp\Compiler;
69+
70+
$scss = new Compiler();
6371
$scss->setImportPaths("assets/stylesheets/");
6472

6573
// will search for `assets/stylesheets/mixins.scss'
@@ -73,7 +81,10 @@ files that SCSS would otherwise not process (such as vanilla CSS imports).
7381
```php
7482
<?php
7583
require "scssphp/scss.inc.php";
76-
$scss = new scssc();
84+
85+
use Leafo\ScssPhp\Compiler;
86+
87+
$scss = new Compiler();
7788
$scss->addImportPath(function($path) {
7889
if (!file_exists('stylesheets/'.$path)) return null;
7990
return 'stylesheets/'.$path;
@@ -90,15 +101,15 @@ default formatter.
90101

91102
Three formatters are included:
92103

93-
* `scss_formatter`
94-
* `scss_formatter_nested` *(default)*
95-
* `scss_formatter_compressed`
104+
* `Leafo\ScssPhp\Formatter\Expanded`
105+
* `Leafo\ScssPhp\Formatter\Nested` *(default)*
106+
* `Leafo\ScssPhp\Formatter\Compressed`
96107

97108
We can change the formatting using the `setFormatter` method.
98109

99110
* <p>`setFormatter($formatterName)` sets the current formatter to `$formatterName`,
100111
the name of a class as a string that implements the formatting interface. See
101-
the source for `scss_formatter` for an example.
112+
the source for `Leafo\ScssPhp\Formatter\Expanded` for an example.
102113
</p>
103114

104115
Given the following SCSS:
@@ -123,7 +134,7 @@ Given the following SCSS:
123134

124135
The formatters will output,
125136

126-
`scss_formatter`:
137+
`Leafo\ScssPhp\Formatter\Expanded`:
127138

128139
```css
129140
.navigation ul {
@@ -138,7 +149,7 @@ The formatters will output,
138149
}
139150
```
140151

141-
`scss_formatter_nested`:
152+
`Leafo\ScssPhp\Formatter\Nested`:
142153

143154
```css
144155
.navigation ul {
@@ -151,7 +162,7 @@ The formatters will output,
151162
color: silver; }
152163
```
153164

154-
`scss_formatter_compressed`:
165+
`Leafo\ScssPhp\Formatter\Compressed`:
155166

156167
```css
157168
.navigation ul{line-height:20px;color:blue;}.navigation ul a{color:red;}.footer .copyright{color:silver;}
@@ -198,7 +209,9 @@ together. PHP's anonymous function syntax is used to define the function.
198209

199210
```php
200211
<?php
201-
$scss = new scssc();
212+
use Leafo\ScssPhp\Compiler;
213+
214+
$scss = new Compiler();
202215

203216
$scss->registerFunction("add-two", function($args) {
204217
list($a, $b) = $args;
@@ -223,7 +236,7 @@ files if they've been modified (or one of the imports has been modified).
223236

224237
### Using `serveFrom`
225238

226-
`scss_server::serveFrom` is a simple to use function that should handle most cases.
239+
`Server::serveFrom` is a simple to use function that should handle most cases.
227240

228241
For example, create a file `style.php`:
229242

@@ -232,13 +245,16 @@ For example, create a file `style.php`:
232245
$directory = "stylesheets";
233246

234247
require "scssphp/scss.inc.php";
235-
scss_server::serveFrom($directory);
248+
249+
use Leafo\ScssPhp\Server;
250+
251+
Server::serveFrom($directory);
236252
```
237253

238254
Going to the URL `example.com/style.php/style.scss` will attempt to compile
239255
`style.scss` from the `stylesheets` directory, and serve it as CSS.
240256

241-
* <p>`scss_server::serveFrom($directory)` will serve SCSS files out of
257+
* <p>`Server::serveFrom($directory)` will serve SCSS files out of
242258
`$directory`. It will attempt to get the path to the file out of
243259
`$_SERVER["PATH_INFO"]`. (It also looks at the GET parameter `p`)
244260
</p>
@@ -262,14 +278,14 @@ directory. It writes its cache in a special directory called `scss_cache`.
262278
Also, because SCSS server writes headers, make sure no output is written before
263279
it runs.
264280

265-
### Using `scss_server`
281+
### Using `Leafo\ScssPhp\Server`
266282

267-
Creating an instance of `scss_server` is just another way of accomplishing what
268-
`serveFrom` does. It let's us customize the cache directory and the instance
269-
of the `scssc` that is used to compile
283+
Creating an instance of `Server` is just another way of accomplishing what
284+
`serveFrom` does. It lets us customize the cache directory and the instance
285+
of the `Compiler` that is used to compile
270286

271287

272-
* <p>`new scss_server($sourceDir, $cacheDir, $scss)` creates a new server that
288+
* <p>`new Server($sourceDir, $cacheDir, $scss)` creates a new server that
273289
serves files from `$sourceDir`. The cache dir is where the cached compiled
274290
files are placed. When `null`, `$sourceDir . "/scss_cache"` is used. `$scss`
275291
is the instance of `scss` that is used to compile.
@@ -283,10 +299,13 @@ Here's an example of creating a SCSS server that outputs compressed CSS:
283299
<?php
284300
require "scssphp/scss.inc.php";
285301

286-
$scss = new scssc();
302+
use Leafo\ScssPhp\Compiler;
303+
use Leafo\ScssPhp\Server;
304+
305+
$scss = new Compiler();
287306
$scss->setFormatter("scss_formatter_compressed");
288307

289-
$server = new scss_server("stylesheets", null, $scss);
308+
$server = new Server("stylesheets", null, $scss);
290309
$server->serve();
291310
```
292311

@@ -301,6 +320,6 @@ If passed the flag `-v`, input is ignored and the current version if returned.
301320
The flag `-f` can be used to set the [formatter](#Output_formatting):
302321

303322
```bash
304-
$ ./pscss -f scss_formatter_compressed < styles.scss
323+
$ bin/pscss -f scss_formatter_compressed < styles.scss
305324
```
306325

site/index.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Follow the author on twitter: [@moonscript](http://twitter.com/moonscript).
2020
<a name="installing"></a>
2121
## Installing
2222

23-
You can always download the latest version here:
23+
You can always download the latest version here:
2424
<a href="$root/src/scssphp-$current_version.tar.gz" id="download-link">scssphp-$current_version.tar.gz</a>
2525

26-
You can also find the latest source online:
26+
You can also find the latest source online:
2727
<https://github.com/leafo/scssphp/>
2828

2929
If you use [Packagist][2] for installing packages, then you can update your `composer.json` like so:
@@ -54,7 +54,10 @@ Create a file, like `style.php`:
5454
$directory = "stylesheets";
5555

5656
require "scssphp/scss.inc.php";
57-
scss_server::serveFrom($directory);
57+
58+
use Leafo\ScssPhp\Server;
59+
60+
Server::serveFrom($directory);
5861

5962
```
6063

@@ -74,13 +77,17 @@ must have permission to write in `scss_cache`.
7477

7578
### Compiler Interface
7679

77-
If you're interested in directly using the compiler, then all you need to do is
78-
require `scss.inc.php` and invoke the `scss` class:
80+
If you're interested in directly using the compiler, then all you need to either
81+
require `scss.inc.php` or use your `composer` generated auto-laoder, and then
82+
invoke the `Compiler` class:
7983

8084
```php
8185
<?php
8286
require "scssphp/scss.inc.php";
83-
$scss = new scssc();
87+
88+
use Leafo\ScssPhp\Compiler;
89+
90+
$scss = new Compiler();
8491

8592
echo $scss->compile('
8693
$color: #abc;
@@ -104,6 +111,9 @@ Find any issues? I'd love to fix them for you, post about them on [the issues tr
104111
<div id="changelog"></div>
105112
## Changelog
106113

114+
* **0.1.0** -- Aug 9, 2014
115+
* raise PHP requirement (5.3+)
116+
* reformat/reorganize source files to be PSR-2 compliant
107117
* **0.0.15** -- Aug 6, 2014
108118
* fix regression with default values in functions (torkiljohnsen)
109119
* **0.0.14** -- Aug 5, 2014
@@ -148,7 +158,7 @@ Find any issues? I'd love to fix them for you, post about them on [the issues tr
148158
* Add == and != ops for colors.
149159
* @if and @while directives should treat null like false.
150160
* Add pscss as bin in composer.json (Christian Lück).
151-
* Fix !default bug (James Shannon, Alberto Aldegheri).
161+
* Fix !default bug (James Shannon, Alberto Aldegheri).
152162
* Fix mixin content includes (James Shannon, Christian Brandt).
153163
* Fix passing of varargs to another mixin.
154164
* Fix interpolation bug in expToString() (Matti Jarvinen).

site/site.moon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ require "sitegen"
33
tools = require "sitegen.tools"
44

55
sitegen.create_site =>
6-
@current_version = "0.0.15"
6+
@current_version = "0.1.0"
77
@title = "SCSS Compiler in PHP"
88

9-
scssphp = tools.system_command "pscss < %s > %s", "css"
9+
scssphp = tools.system_command "bin/pscss < %s > %s", "css"
1010
build scssphp, "style.scss", "style/style.css"
1111

1212
deploy_to "leaf@leafo.net", "www/scssphp/"

0 commit comments

Comments
 (0)