Update installation instructions in the README.

This commit is contained in:
Natalie Weizenbaum 2016-10-21 20:55:54 -07:00
parent 1efefb1524
commit f82974a29f

View File

@ -1,10 +1,71 @@
A [Dart](https://www.dartlang.org) implementation of
[Sass](http://sass-lang.com/).
A [Dart][dart] implementation of [Sass][sass]. **Sass makes CSS fun again**.
[dart]: https://www.dartlang.org
[sass]: http://sass-lang.com/
* [Using Dart Sass](#using-dart-sass)
* [Standalone](#standalone)
* [From NPM](#from-npm)
* [From Pub](#from-pub)
* [From Source](#from-source)
* [Goals](#goals)
* [Behavioral Differences](#behavioral-differences)
## Using Dart Sass
Dart Sass isn't ready for distribution yet, but it's possible to test it out by
running from source. This assumes you've already checked out this repository.
There are a few different ways to install and run Dart Sass, depending on your
environment and your needs.
### Standalone
You can download the standalone Dart Sass archive for your operating
system—containing the Dart VM and the a snapshot of the Sass library—from
[the release page][releases]. Extract it, add the directory to your path, and
the `dart-sass` executable is ready to run!
[releases]: https://github.com/sass/dart-sass/releases/tag/1.0.0-alpha.1
### From NPM
Dart Sass is available, compiled to JavaScript, [as an NPM package][npm]. You
can install it globally using `npm install -g dart-sass`, or to your project
using `npm install dart-sass`. This provides a `dart-sass` executable as well as
a library:
[npm]: https://www.npmjs.com/package/dart-sass
```js
var sass = require('dart-sass');
var result = sass.render({file: scss_filename});
```
The `render()` function will eventually support the same API as
[node-sass's][render], but today it only supports the `file` option.
[render]: https://github.com/sass/node-sass#options
### From Pub
If you're a Dart user, you can install Dart Sass globally using `pub global
install dart-sass`, which will provide a `dart-sass` executable. You can also
add it to your pubspec and use it as a library:
```dart
import 'package:sass/sass.dart' as sass;
void main(List<String> args) {
print(sass.render(args.first));
}
```
See [the Dart API docs][api] for details.
[api]: https://www.dartdocs.org/documentation/sass/latest/sass/sass-library.html
### From Source
Assuming you've already checked out this repository:
1. [Install Dart](https://www.dartlang.org/install). If you download it
manually, make sure the SDK's `bin` directory is on your `PATH`.