A library to convert ANSI escapes (terminal formatting/color codes) to HTML [closed]

Solution 1:

aha is a C-language program, available in an Ubuntu package, at http://ziz.delphigl.com/tool_aha.php or on github https://github.com/theZiz/aha, that takes an input with terminal colors by pipe or file and puts a (w3c conform) HTML-File in stdout. Example:

ls --color=always | aha > ls-output.htm

or

ls --color=always | aha --black > ls-output.htm

for a terminal-like look with black background.

Compile it by "make" and put it where ever you want.

It would be great to get Feedback. ;-)

Solution 2:

Mature Python library and command line tool which is still maintained: pycontribs/ansi2html

Alternatively, for the Bourne shell: ansi2html.sh

Solution 3:

There seems to be an HTML::FromANSI Perl module.