refactor: cleanup utils macros
This commit is contained in:
parent
346ebc83d7
commit
0b355b498c
18 changed files with 285 additions and 297 deletions
28
README.md
28
README.md
|
|
@ -43,6 +43,34 @@ _Section 2_
|
|||
|
||||
Alternatively, you can use the built-in render.
|
||||
|
||||
```rust
|
||||
use orgize::{HtmlHandler, Render};
|
||||
use std::io::Cursor;
|
||||
|
||||
fn main() {
|
||||
let contents = r#"* Title 1
|
||||
*Section 1*
|
||||
** Title 2
|
||||
_Section 2_
|
||||
* Title 3
|
||||
/Section 3/
|
||||
* Title 4
|
||||
=Section 4="#;
|
||||
|
||||
let cursor = Cursor::new(Vec::new());
|
||||
let mut render = Render::new(HtmlHandler, cursor, &contents);
|
||||
|
||||
render
|
||||
.render()
|
||||
.expect("something went wrong rendering the file");
|
||||
|
||||
println!(
|
||||
"{}",
|
||||
String::from_utf8(render.into_wirter().into_inner()).expect("invalid utf-8")
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue