ansi2html

Package Contents

class Ansi2HTMLConverter(latex=False, inline=False, dark_bg=True, line_wrap=True, font_size='normal', linkify=False, escaped=True, markup_lines=False, output_encoding='utf-8', scheme='ansi2html', title='')[source]

Bases: object

Convert Ansi color codes to CSS+HTML

Example: >>> conv = Ansi2HTMLConverter() >>> ansi = ” “.join(sys.stdin.readlines()) >>> html = conv.convert(ansi)

apply_regex(self, ansi)[source]
_apply_regex(self, ansi, styles_used)[source]
_collapse_cursor(self, parts)[source]

Act on any CursorMoveUp commands by deleting preceding tokens

prepare(self, ansi='', ensure_trailing_newline=False)[source]

Load the contents of ‘ansi’ into this object

attrs(self)[source]

Prepare attributes for the template

convert(self, ansi, full=True, ensure_trailing_newline=False)[source]
produce_headers(self)[source]