mirror of
https://codeberg.org/demostf/edit.git
synced 2026-10-01 07:34:05 +02:00
document rust api
This commit is contained in:
parent
06baf1b809
commit
e7bbd1c090
4 changed files with 26 additions and 6 deletions
20
README.md
20
README.md
|
|
@ -1 +1,21 @@
|
|||
# Demo editor
|
||||
|
||||
## Rust api
|
||||
|
||||
```rust
|
||||
use edit::{edit, EditOptions, TickRange};
|
||||
|
||||
fn main() {
|
||||
let options = EditOptions {
|
||||
unlock_pov: true,
|
||||
cut: Some(TickRange {
|
||||
from: 1000.into(),
|
||||
to: 2000.into(),
|
||||
}),
|
||||
..EditOptions::default()
|
||||
};
|
||||
let input = fs::read("in.demo").unwrap();
|
||||
let output = edit(&input, options);
|
||||
fs::write("out.dem", output).unwrap();
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue