aha1
Convert ansi escape sequences to html
Usage
aha [-bhlnprsvwx]
[-c
file]
[-f
file]
[-i
X]
[-L
LANG]
[-t
TITLE]
[-y
STYLE]
Overview
aha reads ECMA-48 SGR-colored text from the standard input, converts it to colored HTML and writes it to the standard output. The options are as follows:
-
-b, --black -
Style HTML output to use a black background with white text.
-
-c file, --css file -
Adds the given css file to the output. In fact just adds <link rel="stylesheet" href=" file " /> to the header.
-
-f file -
Read from file instead of from the standard input.
-
-h, --help, -? -
Print help for
ahato the standard output. -
-i X, --iso X -
Use the ISO-8859-X character encoding instead of UTF-8 for the output, where X is a number from 1-16.
-
-l, --line-fix -
Use a fix for inputs using control sequences to change the cursor position. This is a hot fix, thus it may not work with every program.
-
-L LANG, --lang LANG -
Uses theISO-639-1
code LANG for the language. -
-n, --no-header -
Do not enclose HTML output in <html>, <head> and <body> tags.
-
-p, --pink -
Style HTML output to use a pink background.
-
-r, --ignore-cr -
Ignore all carriage-returns (ASCII sign 13, \r) which may lead to double new lines in html.
-
-s, --stylesheet -
Use a stylesheet instead of inline styles.
-
-t TITLE, --title TITLE -
Set the HTML document title to TITLE instead of "stdin" or the filename.
-
-v, --version -
Print version number of
ahato the standard output and exit. -
-w, --word-wrap -
Wrap long lines in the html output. Works with CSS3 supporting browsers and many older ones.
-
-x, --no-xml -
Don't use doctype xml but html (may useful for old browsers like IE)
-
-y STYLE, --style STYLE -
Sets the style used in the <body> element to STYLE after styles set by other parameters.
Examples
Create an HTML file with a black background, a custom title and a larger font-size using aha's help:
$ aha -h | aha -b -t 'the awesome aha help' -y 'font-size:1.875em' > aha-help.html
Create an HTML file with a white background using the output of diff(1):
$ diff -u --color=always oldfile.c newfile.c | aha > diff.html
Create an HTML file with a black background from the output of htop(1). You have to use option -l due the other new-line-commands htop uses:
$ echo q | htop | aha -b -l > htop.html
Create an HTML file from the output of this man page. man(1) uses bold and underline formatting from nroff(1), which ul(1) converts to SGR:
$ MAN_KEEP_FORMATTING=1 COLUMNS=80 man aha | ul | aha > man-aha.html
Releases
8 releases since Debian 7 (Wheezy); the text changed 4 times.
--css since Debian 11 (Bullseye);
--ignore-cr since Debian 11 (Bullseye);
--iso since Debian 11 (Bullseye);
--lang since Debian 11 (Bullseye);
--no-header since Debian 8 (Jessie);
--no-xml since Debian 11 (Bullseye);
--style since Debian 11 (Bullseye);
--stylesheet since Debian 8 (Jessie);
--title since Debian 11 (Bullseye);
--version since Debian 11 (Bullseye);
--word-wrap since Debian 8 (Jessie);
-L since Debian 11 (Bullseye);
-c since Debian 11 (Bullseye);
-f since Debian 11 (Bullseye);
-i since Debian 11 (Bullseye);
-n since Debian 8 (Jessie);
-r since Debian 11 (Bullseye);
-s since Debian 8 (Jessie);
-t since Debian 11 (Bullseye);
-v since Debian 11 (Bullseye);
-w since Debian 8 (Jessie);
-x since Debian 11 (Bullseye);
-y since Debian 11 (Bullseye).