dokutan / esc2html

Convert escape sequences to html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

esc2html

Convert escape sequences to html

Design goals and features:

  • Convert a reasonable subset of ANSI standard and nonstandard escape sequences to html
  • Optionally include Sixel graphics
  • Filter out sequences that have no appropriate representation in html, e.g. cursor movement
  • See test.ansi and test.sixel for a list of currently supported sequences
  • This is not a terminal emulator

Installation

  • Clone this repository
  • Make sure that you have a C++20 capable compiler installed, then type
make
sudo make install

Usage

Input is read from stdin, output is written to stdout. Use the -h option for a list of available options.

Basic example:

cat test.ansi test.sixel | esc2html > test.html

Use the -s option to convert sixel graphics, requires imagemagick convert and base64:

cat test.ansi test.sixel | esc2html -s > test.html

Use the -t and -f options to set the document title and font:

esc2html -t title -f monospace < test.ansi > test.html

Contributing

Your pull requests are welcome.

License

GNU GPLv3 or later, see LICENSE.

About

Convert escape sequences to html

License:GNU General Public License v3.0


Languages

Language:C++ 94.4%Language:Roff 4.2%Language:Makefile 1.3%