Skip to content

Commit 9b94335

Browse files
authored
Update URLs and some formatting (servo#529)
1 parent a3338ef commit 9b94335

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
html5ever is an HTML parser developed as part of the [Servo][] project.
99

10-
It can parse and serialize HTML according to the [WHATWG](https://whatwg.org/) specs (aka "HTML5"). However, there are some differences in the actual behavior currently, most of which are documented [in the bug tracker][]. html5ever passes all tokenizer tests from [html5lib-tests][], with most tree builder tests outside of the unimplemented features. The goal is to pass all html5lib tests, while also providing all hooks needed by a production web browser, e.g. `document.write`.
10+
It can parse and serialize HTML according to the [WHATWG](https://whatwg.org/) specs (aka "HTML5"). However, there are some differences in the actual behavior currently, most of which are documented [in the bug tracker][]. html5ever passes all tokenizer tests from [html5lib-tests][], with most tree builder tests outside of the unimplemented features. The goal is to pass all html5lib tests, while also providing all hooks needed by a production web browser, e.g. `document.write`.
1111

12-
Note that the HTML syntax is very similar to XML. For correct parsing of XHTML, use an XML parser (That said, many XHTML documents in the wild are serialized in an HTML-compatible form).
12+
Note that the HTML syntax is very similar to XML. For correct parsing of XHTML, use an XML parser (that said, many XHTML documents in the wild are serialized in an HTML-compatible form).
1313

14-
html5ever is written in [Rust][], therefore it avoids the notorious security problems that come along with using C. Being built with Rust also makes the library come with the high-grade performance you would expect from an HTML parser written in C. html5ever is basically a C HTML parser, but without needing a garbage collector or other heavy runtime processes.
14+
html5ever is written in [Rust][], therefore it avoids the notorious security problems that come along with using C. Being built with Rust also makes the library come with the high-grade performance you would expect from an HTML parser written in C. html5ever is basically a C HTML parser, but without needing a garbage collector or other heavy runtime processes.
1515

1616

1717
## Getting started in Rust
@@ -25,6 +25,7 @@ html5ever = "0.27"
2525

2626
You should also take a look at [`examples/html2html.rs`], [`examples/print-rcdom.rs`], and the [API documentation][].
2727

28+
2829
## Getting started in other languages
2930

3031
Bindings for Python and other languages are much desired.
@@ -45,7 +46,7 @@ Run `cargo doc` in the repository root to build local documentation under `targe
4546

4647
html5ever uses callbacks to manipulate the DOM, therefore it does not provide any DOM tree representation.
4748

48-
html5ever exclusively uses UTF-8 to represent strings. In the future it will support other document encodings (and UCS-2 `document.write`) by converting input.
49+
html5ever exclusively uses UTF-8 to represent strings. In the future it will support other document encodings (and UCS-2 `document.write`) by converting input.
4950

5051
The code is cross-referenced with the WHATWG syntax spec, and eventually we will have a way to present code and spec side-by-side.
5152

@@ -56,5 +57,5 @@ html5ever builds against the official stable releases of Rust, though some optim
5657
[Rust]: https://www.rust-lang.org/
5758
[in the bug tracker]: https://github.com/servo/html5ever/issues?q=is%3Aopen+is%3Aissue+label%3Aweb-compat
5859
[html5lib-tests]: https://github.com/html5lib/html5lib-tests
59-
[`examples/html2html.rs`]: https://github.com/servo/html5ever/blob/master/rcdom/examples/html2html.rs
60-
[`examples/print-rcdom.rs`]: https://github.com/servo/html5ever/blob/master/rcdom/examples/print-rcdom.rs
60+
[`examples/html2html.rs`]: https://github.com/servo/html5ever/blob/main/rcdom/examples/html2html.rs
61+
[`examples/print-rcdom.rs`]: https://github.com/servo/html5ever/blob/main/rcdom/examples/print-rcdom.rs

xml5ever/Cargo.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
[package]
2-
32
name = "xml5ever"
43
version = "0.18.0"
54
authors = ["The xml5ever project developers"]
65
license = "MIT OR Apache-2.0"
76
repository = "https://github.com/servo/html5ever"
8-
description = "Push based streaming parser for xml"
9-
documentation = "https://docs.rs/xml5ever/"
10-
11-
homepage = "https://github.com/servo/html5ever/blob/master/xml5ever/README.md"
7+
description = "Push based streaming parser for XML."
8+
documentation = "https://docs.rs/xml5ever"
9+
homepage = "https://github.com/servo/html5ever/blob/main/xml5ever/README.md"
1210
readme = "README.md"
1311
keywords = ["xml", "xml5", "parser", "parsing"]
1412
exclude = ["xml5lib-tests/*"]
15-
categories = [ "parser-implementations", "web-programming" ]
13+
categories = ["parser-implementations", "web-programming"]
1614
edition = "2021"
1715

1816
[dependencies]
1917
log = "0.4"
2018
mac = "0.1"
21-
markup5ever = {version = "0.12", path = "../markup5ever" }
19+
markup5ever = { version = "0.12", path = "../markup5ever" }
2220

2321
[dev-dependencies]
2422
criterion = "0.3"

xml5ever/examples/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ First let's define our dependencies:
2222
```
2323

2424
With dependencies declared, we can now make a simple tokenizer sink. First step is to
25-
define a [`TokenSink`](https://ygg01.github.io/docs/xml5ever/xml5ever/tokenizer/trait.TokenSink.html). [`TokenSink`](https://ygg01.github.io/docs/xml5ever/xml5ever/tokenizer/trait.TokenSink.html) are traits that received stream of [`Tokens`](https://ygg01.github.io/docs/xml5ever/xml5ever/tokenizer/enum.Token.html).
25+
define a [`TokenSink`](https://docs.rs/xml5ever/latest/xml5ever/tokenizer/trait.TokenSink.html). [`TokenSink`](https://docs.rs/xml5ever/latest/xml5ever/tokenizer/trait.TokenSink.html) are traits that received stream of [`Tokens`](https://docs.rs/xml5ever/latest/xml5ever/tokenizer/enum.Token.html).
2626

2727
In our case we'll define a unit struct (i.e. a struct without any fields).
2828

2929
```rust
3030
struct SimpleTokenPrinter;
3131
```
3232

33-
To make `SimpleTokenPrinter` a [`TokenSink`](https://ygg01.github.io/docs/xml5ever/xml5ever/tokenizer/trait.TokenSink.html), we need to implement [process_token](https://ygg01.github.io/docs/xml5ever/xml5ever/tokenizer/trait.TokenSink.html#tymethod.process_token) method.
33+
To make `SimpleTokenPrinter` a [`TokenSink`](https://docs.rs/xml5ever/latest/xml5ever/tokenizer/trait.TokenSink.html), we need to implement [process_token](https://docs.rs/xml5ever/latest/xml5ever/tokenizer/trait.TokenSink.html#tymethod.process_token) method.
3434

3535
```rust
3636
impl TokenSink for SimpleTokenPrinter {
@@ -64,7 +64,7 @@ To make `SimpleTokenPrinter` a [`TokenSink`](https://ygg01.github.io/docs/xml5ev
6464
```
6565

6666
Now, we need some input to process. For input we'll use `stdin`. However, xml5ever `tokenize_to` method only takes `StrTendril`. So we need to construct a
67-
[`ByteTendril`](https://doc.servo.org/tendril/type.ByteTendril.html) using `ByteTendril::new()`, then read the `stdin` using [`read_to_tendril`](https://doc.servo.org/tendril/trait.ReadExt.html#tymethod.read_to_tendril) extension.
67+
[`ByteTendril`](https://docs.rs/tendril/latest/tendril/type.ByteTendril.html) using `ByteTendril::new()`, then read the `stdin` using [`read_to_tendril`](https://docs.rs/tendril/latest/tendril/trait.ReadExt.html#tymethod.read_to_tendril) extension.
6868

6969
Once that is set, to make `SimpleTokenPrinter` parse the input, call,
7070
`tokenize_to` with it as the first parameter, input wrapped in Option for second parameter and XmlToke.
@@ -96,7 +96,7 @@ Once that is set, to make `SimpleTokenPrinter` parse the input, call,
9696

9797
NOTE: `unwrap` causes panic, it's only OK to use in simple examples.
9898

99-
For full source code check out: [`examples/simple_xml_tokenizer.rs`](https://github.com/Ygg01/xml5ever/blob/master/examples/simple_xml_tokenizer.rs)
99+
For full source code check out: [`examples/simple_xml_tokenizer.rs`](https://github.com/servo/html5ever/blob/main/xml5ever/examples/simple_xml_tokenizer.rs)
100100

101101
Once we have successfully compiled the example we run the example with inline
102102
xml
@@ -105,7 +105,7 @@ xml
105105
cargo script simple_xml_tokenizer.rs <<< "<xml>Text with <b>bold words</b>!</xml>"
106106
```
107107

108-
or by sending an [`examples/example.xml`](https://github.com/Ygg01/xml5ever/blob/master/examples/simple_xml_tokenizer.rs) located in same folder as examples.
108+
or by sending an [`examples/example.xml`](https://github.com/servo/html5ever/blob/main/xml5ever/examples/example.xml) located in same folder as examples.
109109

110110
```bash
111111
cargo script simple_xml_tokenizer.rs < example.xml
@@ -153,8 +153,8 @@ First part is similar to making SimpleTokenPrinter:
153153
let input = input.try_reinterpret().unwrap();
154154
```
155155

156-
This time, we need an implementation of [`TreeSink`](https://ygg01.github.io/docs/xml5ever/xml5ever/tree_builder/interface/trait.TreeSink.html). xml5ever comes with a
157-
built-in `TreeSink` implementation called [`RcDom`](https://ygg01.github.io/docs/xml5ever/xml5ever/rcdom/struct.RcDom.html). To process input into
156+
This time, we need an implementation of [`TreeSink`](https://docs.rs/xml5ever/latest/xml5ever/tree_builder/trait.TreeSink.html). xml5ever comes with a
157+
built-in `TreeSink` implementation called [`RcDom`](https://docs.rs/markup5ever_rcdom/latest/markup5ever_rcdom/struct.RcDom.html). To process input into
158158
a `TreeSink` we use the following line:
159159

160160
```rust
@@ -220,4 +220,4 @@ kind of function that will help us traverse it. We shall call that function `wal
220220
}
221221
```
222222

223-
For full source code check out: [`examples/xml_tree_printer.rs`](https://github.com/Ygg01/xml5ever/blob/master/examples/xml_tree_printer.rs)
223+
For full source code check out: [`examples/xml_tree_printer.rs`](https://github.com/servo/html5ever/blob/main/rcdom/examples/xml_tree_printer.rs)

0 commit comments

Comments
 (0)