AHA(1)
β¨ AHA(1) β General Commands Manual π
πΈ NAME
okay bestie, aha is the tool that turns ANSI escape sequences into HTML π
Literally that's the whole vibe: colored terminal text goes in, pretty HTML comes out π¦
π SYNOPSIS
aha [-bhlnprsvwx] [-c file] [-f file] [-i X] [-L LANG] [-t TITLE]
[-y STYLE]
π DESCRIPTION
so aha reads ECMA-48 SGR-colored text from the standard input, converts it to colored HTML, and writes it to the standard output π¨οΈβ¨ here are all the options, obsessed with them tbh:
-b,--blackβ styles the HTML output with a black background and white text π€-c file,--css fileβ adds the given css file to the output. it literally just slaps <link rel="stylesheet" href=" file " /> into the header π-f fileβ reads from file instead of the standard input π-h,--help,-?β prints help forahato the standard output πββοΈ-i X,--iso Xβ uses the ISO-8859-X character encoding instead of UTF-8 for the output, where X is a number from 1-16 π-l,--line-fixβ applies a fix for inputs that use control sequences to change the cursor position. ngl it's a hot fix, so it may not work with every program π₯-L LANG,--lang LANGβ sets the language to the ISO-639-1 code LANG π£οΈ-n,--no-headerβ doesn't wrap the HTML output in<html>,<head>and<body>tags π-p,--pinkβ styles the HTML output with a pink background π-r,--ignore-crβ ignores all carriage-returns (ASCII sign 13,\r), which can lead to double new lines in html π-s,--stylesheetβ uses a stylesheet instead of inline styles π¨-t TITLE,--title TITLEβ sets the HTML document title to TITLE instead of"stdin"or the filename π·οΈ-v,--versionβ prints the version number ofahato the standard output and exits π§Ύ-w,--word-wrapβ wraps long lines in the html output. works with CSS3 supporting browsers and plenty of older ones too π-x,--no-xmlβ uses doctype html instead of doctype xml (may be useful for old browsers like IE) π¦-y STYLE,--style STYLEβ sets the style used in the<body>element to STYLE, applied after the styles set by other parameters π
π¦ EXAMPLES
bestie, these are the moves π
Create an HTML file with a black background, a custom title, and a larger font-size using aha's own 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 from 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 because of 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, so it's giving full glow-up π
$ MAN_KEEP_FORMATTING=1 COLUMNS=80 man aha | ul | aha >
man-aha.html
π SEE ALSO
console_codes(4) π
Control Functions for Coded Character Sets, Ecma, ECMA-48, 61, 1991. π
π AUTHORS
The aha utility is maintained by Alexander Matthes βZizβ <ziz@mailbox.org>. slay, Ziz π«Ά
π BUGS
okay so this one's a little sad π blinking text using the HTML tag <blink> and the css property text-decoration:blink have been deprecated on modern browsers, so you need option -s and have to redefine the .blink css class. not me having to do extra work π
Debian Β· August 4, 2020 Β· AHA(1) β stay sparkly, bestie π¦π
π¦ where this page comes from
- alpine 3.24: aha-doc 0.5.1-r3 Β· MPL-1.1
- arch rolling: aha 0.5.1-3 Β· MPL-1.1 AND LGPL-2.0-or-later
- debian bookworm: aha 0.5.1-3 Β· MPL-1.1 OR LGPL-3.0-or-later
- debian trixie: aha 0.5.1-3 Β· MPL-1.1 OR LGPL-3.0-or-later
- epel 10: aha 0.5.1-12.el10_0 Β· MPL-1.1 OR LGPL-2.0-or-later
- epel 9: aha 0.5.1-2.el9 Β· MPLv1.1 or LGPLv2+
- fedora 43: aha 0.5.1-14.fc43 Β· MPL-1.1 OR LGPL-2.0-or-later
- fedora 44: aha 0.5.1-16.fc44 Β· MPL-1.1 OR LGPL-2.0-or-later
- nixos 26.05: aha 0.5.1
- nixpkgs unstable: aha 0.5.1
- opensuse-leap 16.0: aha 0.5.1-bp160.1.6 Β· MPL-1.1 OR LGPL-2.1-or-later
- opensuse-leap 16.0: aha 0.5.1-bp160.1.6 Β· MPL-1.1 OR LGPL-2.1-or-later
- opensuse-leap 16.0: aha 0.5.1-bp160.1.6 Β· MPL-1.1 OR LGPL-2.1-or-later
- opensuse-leap 16.0: aha 0.5.1-bp160.1.6 Β· MPL-1.1 OR LGPL-2.1-or-later
- ubuntu jammy: aha 0.5.1-2 Β· MPL-1.1 OR LGPL-3.0-or-later
- ubuntu noble: aha 0.5.1-3build1 Β· MPL-1.1 OR LGPL-3.0-or-later
- ubuntu resolute: aha 0.5.1-3build2 Β· MPL-1.1 OR LGPL-3.0-or-later
- ubuntu stonking: aha 0.5.1-3build2 Β· MPL-1.1 OR LGPL-3.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms