Skip to content

Commit 7345400

Browse files
author
yggverse
committed
update readme
1 parent 8eaad1d commit 7345400

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ match Multiline::begin_from("```alt") {
7272

7373
#### Header
7474

75+
**Struct**
76+
7577
``` rust
76-
match Header::from("# H1") {
78+
match Header::parse("# H1") {
7779
Some(h1) => {
7880
assert_eq!(h1.level as u8, Level::H1 as u8);
7981
assert_eq!(h1.value, "H1");
@@ -82,6 +84,15 @@ match Header::from("# H1") {
8284
} // H1, H2, H3
8385
```
8486

87+
**Trait**
88+
89+
``` rust
90+
use ggemtext::line::header::{Gemtext, Level};
91+
assert_eq!("# H1".as_value(), Some("H1"));
92+
assert_eq!("H1".to_source(&Level::H1), "# H1");
93+
// H1, H2, H3
94+
```
95+
8596
#### Link
8697

8798
``` rust
@@ -135,7 +146,7 @@ assert_eq!("Item".to_source(), "* Item")
135146
**Struct**
136147

137148
``` rust
138-
match Quote::from("> Quote") {
149+
match Quote::parse("> Quote") {
139150
Some(quote) => assert_eq!(quote.value, "Quote"),
140151
None => assert!(false),
141152
}

0 commit comments

Comments
 (0)