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 for aha to 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 of aha to 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