All Projects → andre-simon → ansifilter

andre-simon / ansifilter

Licence: GPL-3.0 license
ANSI sequence filter

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to ansifilter

Term-ExtendedColor
Color screen output using extended escape sequences
Stars: ✭ 17 (-50%)
Mutual labels:  escape-sequences
swift-commandlinekit
Framework supporting the development of command-line tools in Swift on macOS and Linux. The framework supports managing command-line arguments, provides lightweight functions to deal with escape sequences, and defines an API for reading strings from the terminal.
Stars: ✭ 38 (+11.76%)
Mutual labels:  escape-sequences
unescape-js
Unescape special characters encoded by JavaScript escape sequences
Stars: ✭ 36 (+5.88%)
Mutual labels:  escape-sequences
ansiart2utf8
Processes legacy BBS-style ANSI art (ACiDDraw, PabloDraw, etc.) to UTF-8. Escape codes and line endings are processed for terminal friendliness.
Stars: ✭ 32 (-5.88%)
Mutual labels:  escape-sequences
stellarized
✦ paint vim with the stars ✦
Stars: ✭ 70 (+105.88%)
Mutual labels:  truecolor
*** Since Github is now part of Mordor Corp, the ansifilter Git repo       ***
*** moved to https://gitlab.com/saalen/ansifilter                          ***

-------------------------------------------------------------------------------
---  ANSIFILTER MANUAL - Version 2.9  ---------------------- NOVEMBER 2017 ---
-------------------------------------------------------------------------------

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. Environment variables
5. Color mapping
6. Contact


1.  Quick introduction
-------------------------------------------------------------------------------

Invocation: ansifilter [OPTION]... [FILE]...

ansifilter handles text files containing ANSI terminal escape codes.

File handling:
  -i, --input=<file>     Name of input file
  -o, --output=<file>    Name of 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
      --no-trailing-nl   Omit trailing newline
      --no-version-info  Omit version info comment
      --wrap-no-numbers  Omit line numbers of wrapped lines (assumes -l)

ANSI art options:
      --art-cp437        Parse codepage 437 ANSI art (HTML, RTF output)
      --art-bin          Parse BIN/XBIN ANSI art (HTML output, no stdin)
      --art-tundra       Parse Tundra ANSI art (HTML output, no stdin)
      --art-width        Set ANSI art width (default 80)
      --art-height       Set ANSI 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

Parsing XBIN files overrides --art-width, --art-height and --map options.
The ANSI art file formats BIN, XBIN and TND cannot be read from stdin.

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, BIN/XBIN and Tundra files) is enabled with 
the --art-cp437 and --art-bin options.
Parsing XBIN files overrides --art-width, --art-height and --map options.
Parsing TND files overrides --art-width 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.  ENVIRONMENT VARIABLES
-------------------------------------------------------------------------------

The command line version recognizes these variables:

ANSIFILTER_OPTIONS: may contain command line options, but no input file paths.


5.  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


6.  Contact
-------------------------------------------------------------------------------

Andre Simon
[email protected]
http://www.andre-simon.de/

sf.net project with SVN repository, download mirror, bug tracker, help forum:
http://sourceforge.net/projects/ansifilter/

Github project with Git repository, bug tracker:
https://github.com/andre-simon/ansifilter
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].