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

Side by Side Diff: third_party/pkg/html5lib/README.md

Issue 22375011: move html5lib code into dart svn repo (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
OLDNEW
(Empty)
1 html5lib in Pure Dart
2 =====================
3
4 This is a pure [Dart][dart] [html5 parser][html5parse]. It's a port of
5 [html5lib](http://code.google.com/p/html5lib/) from Python. Since it's 100%
6 Dart you can use it safely from a script or server side app.
7
8 Eventually the parse tree API will be compatible with [dart:html][d_html], so
9 the same code will work on the client or the server.
ricow1 2013/08/12 05:51:17 or the server -> and the server
Jennifer Messerly 2013/08/12 17:55:13 Done.
10
11 Installation
12 ------------
13
14 Add this to your `pubspec.yaml` (or create it):
15 ```yaml
16 dependencies:
17 html5lib: any
18 ```
19 Then run the [Pub Package Manager][pub] (comes with the Dart SDK):
20
21 pub install
22
23 Usage
24 -----
25
26 Parsing HTML is easy!
27 ```dart
28 import 'package:html5lib/parser.dart' show parse;
29 import 'package:html5lib/dom.dart';
30
31 main() {
32 var document = parse(
33 '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!');
34 print(document.outerHtml);
35 }
36 ```
37
38 You can pass a String or list of bytes to `parse`.
39 There's also `parseFragment` for parsing a document fragment, and `HtmlParser`
40 if you want more low level control.
41
42 Running Tests
43 -------------
44
45 ```bash
46 # From Dart SVN checkout
47 ./tools/build.py -m release
48 ./tools/test.py -m release html5lib
49 ./tools/test.py -m release -r drt html5lib
50 ```
51
52 [dart]: http://www.dartlang.org/
53 [html5parse]: http://dev.w3.org/html5/spec/parsing.html
54 [d_html]: http://api.dartlang.org/docs/continuous/dart_html.html
55 [files]: http://html5lib.googlecode.com/hg/python/html5lib/
56 [pub]: http://www.dartlang.org/docs/pub-package-manager/
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698