ansi2html(1)
π NAME π
okay bestie, the manual name here is ansi2html, and it's an ansi to HTML converter β¨
β¨ SYNOPSIS β¨
ansi2html [-nwctl] <log >outfile
π¦ DESCRIPTION π¦
okay so ansi2html takes your ANSI log and turns it into an HTML page π It converts the ANSI color codes into the right tags, and all the common colors and attributes are supported. full glam, no notes π
π OPTIONS π
-n,--no-headerβ skips the HTML header π«Ά This is perfect if you wanna drop the log into a web page you're building another way. Just know that you're on the hook for the background color. Go black or something dark in the default on-black mode, or white/light when-wis used. Fancy background images are cute too, as long as they're dark (or light) enough π-w,--whiteβ makes the background white π€ Yes, it's the opposite of most terminals, but it matches most webpages πΈ Text that's asking to be bolded (normally bright white) turns bold black. BUT explicit bright white stays put and becomes invisible π That's the same deal as explicit black being invisible in the normal on-black mode, just like on real terminals (see-c).-c,--contrastβ no invisible text allowed π«π» Whenever the foreground color matches the background, it gets shifted halfway across the color space, so white and black both turn into gray π©Ά ngl this is inaccurate compared to real terminals π But most web users already know how to mouse-highlight "spoiler" text, so it's still useful if you're processing logs that assume a different white-vs-black background than yours.-t,--titletext β sets the page title to the next argument π·οΈ Mutually exclusive with-n, so don't pair them, bestie π ββοΈ-l,--no-wrapβ turns off word-wrapping π By default, ansi2html wraps text like a real terminal does, which is the opposite of what browsers usually do with plain text. Chaotic, but make it make sense.--styletext β injects some text into the stylesheet π It obviously doesn't make any sense with-nπ Example:
--style 'pre {font-family: Consolas}'
π¨ CAVEATS π¨
β οΈ heads up: most ANSI codes that aren't color codes get ignored, which can lead to misformatted output π In general, anything that wouldn't work on a hardcopy terminal won't work here either.
π· SEE ALSO π·
ansi2txt(1), ttyrec2ansi(1), pipetty(1). Go check those out, they're giving main character energy π
That's the whole tea, bestie π«Ά This page was last updated 2018-05-27, and it's still ansi2html(1) iconic π ttyl π β¨
π¦ where this page comes from
- debian bookworm: colorized-logs 2.6-1 Β· MIT
- debian trixie: colorized-logs 2.7-1 Β· MIT
- epel 10: colorized-logs 2.7-1.el10_1 Β· MIT
- epel 9: colorized-logs 2.7-1.el9 Β· MIT
- fedora 43: colorized-logs 2.7-2.fc43 Β· MIT
- fedora 44: colorized-logs 2.7-4.fc44 Β· MIT
- nixos 26.05: colorized-logs 2.7
- nixpkgs unstable: colorized-logs 2.7
- ubuntu jammy: colorized-logs 2.6-1 Β· MIT
- ubuntu noble: colorized-logs 2.6-1 Β· MIT
- ubuntu questing: colorized-logs 2.7-1
- ubuntu resolute: colorized-logs 2.7-1build1 Β· MIT
- ubuntu stonking: colorized-logs 2.7-1build1 Β· MIT
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms