Skip to content
/ ansi2 Public

Parse ansi strings and convert them to html and svg formats

Notifications You must be signed in to change notification settings

ahaoboy/ansi2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parse ansi strings and convert them to html and svg formats

install

It is recommended to use npm, it will compress svg using svgo

npm i ansi2 -g
cargo binstall ansi2
cargo install ansi2 --features="cli"

usage

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

options

format

neofetch | ansi2 --format=html > neofetch.html
neofetch | ansi2 --format=svg > neofetch.svg

theme

vga / vscode / ubuntu

neofetch | ansi2 --format=svg --theme=vscode > neofetch.svg

font

neofetch | ansi2 --format=svg --font=./font.ttf > neofetch.svg

mode

dark / light

neofetch | ansi2 --format=svg --mode=dark > neofetch.svg

example

neofetch

vitest

About

Parse ansi strings and convert them to html and svg formats

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages