aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-03 15:59:37 +0100
committerGitHub <noreply@github.com>2021-12-03 15:59:37 +0100
commitc9c8fcf4daa594c7b3ffe08a64f563f152c22f29 (patch)
tree6ec05fbe26fc4992aa2046f0760327b0c7ff8dc1 /examples
parent5e69d3391b478dda186c8d3e94502537d6895a13 (diff)
Fix typo and add example (#9)
Diffstat (limited to 'examples')
-rw-r--r--examples/tokenize.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs
new file mode 100644
index 0000000..9a039c3
--- /dev/null
+++ b/examples/tokenize.rs
@@ -0,0 +1,9 @@
+//! Let's you easily try out the tokenizer with e.g.
+//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize
+use html5gum::{BufReadReader, Tokenizer};
+
+fn main() {
+ for token in Tokenizer::new(BufReadReader::new(std::io::stdin().lock())).flatten() {
+ println!("{:?}", token);
+ }
+}