Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: pkg/csslib/README.md

Issue 23168002: move csslib into dart svn (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/csslib/bin/css.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 csslib in Pure Dart
2 ===================
3
4 This is a pure [Dart][dart] [CSS parser][cssparse]. Since it's 100%
5 Dart you can use it safely from a script or server side app.
6
7 [![Build Status](https://drone.io/github.com/dart-lang/csslib/status.png)](https ://drone.io/github.com/dart-lang/csslib/latest)
8
9 Installation
10 ------------
11
12 Add this to your `pubspec.yaml` (or create it):
13 ```yaml
14 dependencies:
15 csslib: any
16 ```
17 Then run the [Pub Package Manager][pub] (comes with the Dart SDK):
18
19 pub install
20
21 Usage
22 -----
23
24 Parsing CSS is easy!
25 ```dart
26 import 'package:csslib/parser.dart' show parse;
27 import 'package:csslib/css.dart';
28
29 main() {
30 var stylesheet = parse(
31 '.foo { color: red; left: 20px; top: 20px; width: 100px; height:200px }');
32 print(stylesheet.toString());
33 }
34 ```
35
36 You can pass a String or list of bytes to `parse`.
37
38
39 Updating
40 --------
41
42 You can upgrade the library with:
43
44 pub update
45
46 Disclaimer: the APIs are not finished. Updating may break your code. If that
47 happens, you can check the
48 [commit log](https://github.com/dart-lang/csslib/commits/master), to figure
49 out what the change was.
50
51 If you want to avoid breakage, you can also put the version constraint in your
52 `pubspec.yaml` in place of the word `any`.
53
54 Running Tests
55 -------------
56
57 All tests (both canary and suite) should be passing. Canary are quick test
58 verifies that basic CSS is working. The suite tests are a comprehensive set of
59 ~11,000 tests.
60
61 ```bash
62 export DART_SDK=path/to/dart/sdk
63
64 # Make sure dependencies are installed
65 pub install
66
67 # Run command both canary and the suite tests
68 test/run.sh
69 ```
70
71 Run only the canary test:
72
73 ```bash
74 test/run.sh canary
75 ```
76
77 Run only the suite tests:
78
79 ```bash
80 test/run.sh suite
81 ```
82
83 [dart]: http://www.dartlang.org/
84 [pub]: http://www.dartlang.org/docs/pub-package-manager/
OLDNEW
« no previous file with comments | « no previous file | pkg/csslib/bin/css.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698