mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 17:15:33 +00:00
update readme
This commit is contained in:
parent
8eaad1dac9
commit
7345400172
1 changed files with 13 additions and 2 deletions
15
README.md
15
README.md
|
|
@ -72,8 +72,10 @@ match Multiline::begin_from("```alt") {
|
|||
|
||||
#### Header
|
||||
|
||||
**Struct**
|
||||
|
||||
``` rust
|
||||
match Header::from("# H1") {
|
||||
match Header::parse("# H1") {
|
||||
Some(h1) => {
|
||||
assert_eq!(h1.level as u8, Level::H1 as u8);
|
||||
assert_eq!(h1.value, "H1");
|
||||
|
|
@ -82,6 +84,15 @@ match Header::from("# H1") {
|
|||
} // H1, H2, H3
|
||||
```
|
||||
|
||||
**Trait**
|
||||
|
||||
``` rust
|
||||
use ggemtext::line::header::{Gemtext, Level};
|
||||
assert_eq!("# H1".as_value(), Some("H1"));
|
||||
assert_eq!("H1".to_source(&Level::H1), "# H1");
|
||||
// H1, H2, H3
|
||||
```
|
||||
|
||||
#### Link
|
||||
|
||||
``` rust
|
||||
|
|
@ -135,7 +146,7 @@ assert_eq!("Item".to_source(), "* Item")
|
|||
**Struct**
|
||||
|
||||
``` rust
|
||||
match Quote::from("> Quote") {
|
||||
match Quote::parse("> Quote") {
|
||||
Some(quote) => assert_eq!(quote.value, "Quote"),
|
||||
None => assert!(false),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue