Crates.io | ansi2 |
lib.rs | ansi2 |
version | |
source | src |
created_at | 2024-04-20 02:32:18.036862 |
updated_at | 2024-10-22 12:56:47.967487 |
description | ansi2 |
homepage | |
repository | https://github.com/ahaoboy/ansi2 |
max_upload_size | |
id | 1214291 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Parse ansi strings and convert them to html and svg formats
It is recommended to use npm, it will compress svg using svgo
npm i ansi2 -g
cargo binstall ansi2
cargo install ansi2 --features="cli"
neofetch | ansi2 > ./neofetch.svg
neofetch | ansi2 --format=svg --theme=vscode > neofetch.svg
vitest bench --run | ansi2 --format=html --mode=light > bench.html
vitest bench --run | ansi2 --format=text > bench.txt
vitest bench --run | ansi2 --format=svg --mode=dark | resvg - -c > bench.png
use ansi2::{Canvas};
let canvas = Canvas::new(s);
for row in canvas.pixels.iter() {
for pixel in row.iter() {
// draw pixel
}
}
npm i ansi2 -g
neofetch | ansi2 > ./neofetch.svg
neofetch | ansi2 --format=svg --theme=vscode > neofetch.svg
neofetch | ansi2 --format=html > neofetch.html
neofetch | ansi2 --format=svg > neofetch.svg
vga / vscode / ubuntu
neofetch | ansi2 --format=svg --theme=vscode > neofetch.svg
neofetch | ansi2 --format=svg --font=./font.ttf > neofetch.svg
dark / light
neofetch | ansi2 --format=svg --mode=dark > neofetch.svg