Debian Codegraph @

third_party/rust/weedle2/README.md

raw
1 <div align="center">
2
3 <h1>Weedle 2 - Electric Boogaloo</h1>
4
5 <strong>A Web IDL parser</strong>
6
7 <p>
8 <a href="https://crates.io/crates/weedle2"><img src="https://img.shields.io/crates/v/weedle2.svg?style=flat-square" alt="Crates.io version" /></a>
9 <a href="https://docs.rs/weedle2"><img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="Documentation" /></a>
10 <a href="LICENSE"><img src="https://img.shields.io/crates/l/weedle2/2.0.0?style=flat-square" alt="MIT License" /></a>
11 </p>
12
13 <sub>
14 Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a>.
15 <br>
16 Forked to extend the functionality beyond WebIDL needs.
17 </sub>
18 </div>
19
20 ## About
21
22 Parses valid WebIDL definitions & produces a data structure starting from
23 [`Definitions`](https://docs.rs/weedle/latest/weedle/type.Definitions.html).
24
25 ## Usage
26
27 ### `Cargo.toml`
28
29 ```toml
30 [dependencies]
31 weedle2 = "5.0.0"
32 ```
33
34 ### `src/main.rs`
35
36 ```rust
37 fn main() {
38 let parsed = weedle::parse("
39 interface Window {
40 readonly attribute Storage sessionStorage;
41 };
42 ").unwrap();
43
44 println!("{:?}", parsed);
45 }
46 ```