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

Side by Side Diff: packages/html/README.md

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « packages/html/LICENSE ('k') | packages/html/codereview.settings » ('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 html5 parser in dart
2 ====================
3
4 This is a pure [Dart][dart] [html5 parser][html5parse]. It's a port of
5 [html5lib](https://github.com/html5lib/html5lib-python) 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 and the server.
10
11 (Formerly known as _html5lib_.)
12
13 Installation
14 ------------
15
16 Add this to your `pubspec.yaml` (or create it):
17 ```yaml
18 dependencies:
19 html: any
20 ```
21 Then run the [Pub Package Manager][pub] (comes with the Dart SDK):
22
23 pub install
24
25 Usage
26 -----
27
28 Parsing HTML is easy!
29 ```dart
30 import 'package:html/parser.dart' show parse;
31 import 'package:html/dom.dart';
32
33 main() {
34 var document = parse(
35 '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!');
36 print(document.outerHtml);
37 }
38 ```
39
40 You can pass a String or list of bytes to `parse`.
41 There's also `parseFragment` for parsing a document fragment, and `HtmlParser`
42 if you want more low level control.
43
44 Running Tests
45 -------------
46
47 ```bash
48 ./test/run.sh
49 ```
50
51 [dart]: http://www.dartlang.org/
52 [html5parse]: http://dev.w3.org/html5/spec/parsing.html
53 [d_html]: http://api.dartlang.org/docs/continuous/dart_html.html
54 [files]: http://html5lib.googlecode.com/hg/python/html5lib/
55 [pub]: http://www.dartlang.org/docs/pub-package-manager/
OLDNEW
« no previous file with comments | « packages/html/LICENSE ('k') | packages/html/codereview.settings » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698