Skip to content

Commit a9f85cb

Browse files
committed
docs(readme): add API usage section
Document how to use `svico` as a library with a `Cargo.toml` snippet and a `convert` example, complementing the CLI usage section.
1 parent 1e1962c commit a9f85cb

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,20 @@ Examples:
2222
svico icon.svg
2323
svico icon.svg -o app/favicon.ico
2424
svico icon.svg -s 64,128,256
25+
```
26+
27+
## 🧩 API
28+
29+
Use `svico` as a library to convert SVG to ICO from your own Rust code:
30+
31+
```toml
32+
[dependencies]
33+
svico = "0.1"
34+
```
35+
36+
```rust
37+
fn main() -> anyhow::Result<()> {
38+
svico::convert("icon.svg", "icon.ico", &[16, 24, 32, 256])?;
39+
Ok(())
40+
}
2541
```

0 commit comments

Comments
 (0)