2 Comments

Ansi2html

At times it may be good idea to display the exact terminal output to viewers to easily convey what’s being done. The cut and paste method works fine but ANSI coloring will be lost. Lately I had some friends in the forums to help me figure this out.

Ansi2html is a program that can convert ANSI colored output and display it as a webpage. Ansi2html is one of the programs that is part of kbtin, a MUD-client. For Gentoo users, an ebuild thankfully rids the cruft and only ansi2html is built. Thanks to timeBandit for pointing this out and thanks to tarpman for the ebuild.

Using ansi2html is easy, just enter:

command -color | ansi2html > command.html

The color argument is required because color output is often repressed when output to a console or terminal (most popular commands have them). For example:

emerge -p --color=y frozen-bubble | ansi2html > emerge-frozen-bubble.html

Will give me this:

emerge-frozen-bubble.html link

I was thinking ansi2html might be good for displaying text inline on this Blog (as in preformatted colored text) but ansi2html builds a custom, built-in, css that make this all too unrealistic to build inline.

Have a good day.

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

2 comments on “Ansi2html

  1. Good script Pádraig, thanks for the link.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers

%d bloggers like this: