mirror of
https://codeberg.org/demostf/edit.git
synced 2026-04-21 16:22:44 +02:00
Demo editing tools with js bindings
- Rust 94%
- Nix 2.4%
- JavaScript 2.2%
- TypeScript 1.4%
| js | ||
| wasm | ||
| .envrc | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE_APACHE | ||
| LICENSE_MIT | ||
| out.txt | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| webpack.config.js | ||
Demo editor
Command line editor
Building
cd wasm
cargo b --release --features cli
binary can be found at target/release/edit
Usage
edit [options] <path.dem>
See edit --help for the available options.
Rust api
use edit::{edit, EditOptions, TickRange};
fn main() {
let options = EditOptions::builder()
.unlock_pov(true)
.remove_invalid_deletes(self.remove_invalid_deletes)
.cut(TickRange {
from: from.into(),
to: to.into(),
}).build();
let input = fs::read("in.demo").unwrap();
let output = edit(&input, options);
fs::write("out.dem", output).unwrap();
}