-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
154 lines (114 loc) · 4.72 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
-------------------------------------------------------------------------------
--- ANSIFILTER MANUAL - Version 2.2 ---------------------- September 2016 ---
-------------------------------------------------------------------------------
OSI Certified Open Source Software
-------------------------------------------------------------------------------
Ansifilter handles text files containing ANSI terminal escape codes.
The command sequences may be stripped or be interpreted to generate formatted
output (HTML, RTF, TeX, LaTeX, BBCode, Pango).
CONTENT:
-------------------------------------------------------------------------------
1. Quick introduction
2. Platforms
3. Features
4. Color mapping
5. Contact
1. Quick introduction
-------------------------------------------------------------------------------
Invocation: ansifilter [OPTION]... [FILE]...
ansifilter handles text files containing ANSI terminal escape codes.
File handling:
-i, --input=<file> name of single input file
-o, --output=<file> name of single output file
-O, --outdir=<dir> name of output directory
-t, --tail Continue reading after end-of-file (like tail -f)
Output text formats:
-T, --text (default) Output text
-H, --html Output HTML
-M, --pango Output Pango Markup
-L, --latex Output LaTeX
-P, --tex Output Plain TeX
-R, --rtf Output RTF
-B, --bbcode Output BBCode
Format options:
-a, --anchors add HTML line anchors (assumes -l)
-d, --doc-title Set HTML/LaTeX document title
-e, --encoding Set HTML/RTF encoding (must match input file encoding)
-f, --fragment Omit HTML header and footer
-F, --font=<font> Set HTML/RTF font face
-l, --line-numbers print line numbers in output file
-m, --map=<path> read color mapping file (see README)
-r, --style-ref=<rf> Set HTML/TeX/LaTeX stylesheet path
-s, --font-size=<fs> Set HTML/RTF font size
-p, --plain Ignore ANSI formatting information
-w, --wrap=<len> wrap long lines
--cp437 parse codepage 437 ASCII art (HTML output only)
--wrap-no-numbers omit line numbers of wrapped lines (assumes -l)
ASCII art options:
--art-cp437 Parse codepage 437 ASCII art (HTML, RTF output only)
--art-bin Parse BIN/XBIN ASCII art (HTML, RTF output only)
--art-width Set ASCII art width (default 80)
--art-height Set ASCII art height (default 150)
Other options:
-h, --help Print help
-v, --version Print version and license info
Examples:
ansifilter -i input.ansi -o output.txt
ansifilter *.txt
tail -f server.log | ansifilter
Examples:
ansifilter -i text_with_ansi.txt -o text_without_ansi.txt
ansifilter -i text_with_ansi.txt -o output.html --html
ansifilter *.txt
tail -f server.log | ansifilter
The GUI version (ansifilter-gui) also accepts the first command line argument
as input file name.
2. Platforms
-------------------------------------------------------------------------------
Ansifilter is currently available for Linux and Win32 platforms.
3. Features
-------------------------------------------------------------------------------
Ansifilter understands most CSI sequences. Support for ANSI art files (based on
codepage 437 and ANSI.SYS sequences or BIN/XBIN files) is enabled with the
--art-cp437 and --art-bin options.
Parsing XBIN files overrides --art-width, --art-height and --map options.
Supported SGR parameters:
Formatting: Bold, Underline, Italic, Blink
Colors: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White;
xterm 256 color modes;
16m true color modes
Other: Conceal/Reveal, Image positive/negative
All commands which issue the listed formatting options are supported.
Some options like Blink are not supported by all output formats (like RTF).
4. Color mapping
-------------------------------------------------------------------------------
The basic ANSI color set can be adjusted with a color map file (--map option).
This text configuration overrides these color codes:
Normal: Black (0), Red (1), Green (2), Yellow (3), Blue (4), Magenta (5),
Cyan (6), Gray (7)
Bright: DarkGray (8), Red (9), Green (10), Yellow (11), Blue (12), Magenta (13),
Cyan (14), White (15)
File format:
<0..15> = <HTML color code>
Example file content:
1= #0000aa
2= #00aa00
3= #00aaaa
4= #aa0000
5= #aa00aa
6= #aa5500
7= #aaaaaa
8= #555555
9= #5555ff
10= #55ff55
11= #55ffff
12= #ff5555
13= #ff55ff
14= #ffff55
15= #ffffff
5. Contact
-------------------------------------------------------------------------------
Andre Simon
andre.simon1@gmx.de
http://www.andre-simon.de/
http://wiki.andre-simon.de/