1ansi2html(1) General Commands Manual ansi2html(1)
2
3
4
6 ansi2html - ansi to HTML converter
7
9 ansi2html [-n] [-w] <log >outfile
10
12 ansi2html will convert the ANSI log into an HTML page, converting ANSI
13 color codes into appropriate tags. All common colors and attributes
14 are supported.
15
17 -n, --no-header
18 Don't produce an HTML header. This allows including the log
19 into a web page you make some other way. You are responsible
20 for setting background color appropriately — to black or some‐
21 thing dark in the default on-black mode, or to white/light when
22 -w is used. Fancy-schmancy background images are fine as long
23 as they are dark (or light) enough.
24
25 -w, --white
26 Make the background white. This is contrary to most terminals
27 but matches most webpages. Text requested to be bolded (nor‐
28 mally bright white) will be turned bold black, but explicit
29 bright white will not be changed, becoming invisible (just like
30 explicit black is invisible in the normal on-black mode), same
31 as on real terminals (see -c).
32
33 -c, --contrast
34 Forbid invisible text. Whenever foreground color is same as
35 background, it'll be turned halfway across the color space (so
36 white and black become gray). This is inaccurate wrt real ter‐
37 minals, and most web users already know how to mouse-highlight
38 "spoiler" text, but can be useful if you process logs that
39 assume different white-vs-black background than you.
40
41 -t, --title text
42 Set the page title to the next argument. Mutually exclusive
43 with -n.
44
45 -l, --no-wrap
46 Disable word-wrapping. Like text terminals, ansi2html wraps
47 text by default, which is contrary to the usual browser default
48 for plain text.
49
50 --style text
51 Injects some text into the stylesheet, obviously doesn't make
52 any sense with -n. Example: --style 'pre {font-family: Conso‐
53 las}'
54
56 Most ANSI codes other than color codes are ignored; possibly causing
57 misformatted output. In general, anything unfit for a hardcopy termi‐
58 nal won't work.
59
61 ansi2txt, ttyrec2ansi, pipetty.
62
63
64
65 2018-05-27 ansi2html(1)