Ansible: Render ANSI escapes to HTML Fast!

Hot on the heels of Antilles, we’ve released another gem into the wild:  Ansible.

Ansible is an ANSI-escape to HTML conversion tool that’s fast enough to use on large input. Particularly, it’s meant to be significantly faster than the ansi-sys gem for large input text.

The ansi-sys HTML renderer uses a O(n^2) algorithm to process stateful ANSI escape sequences.  It instantiates a terminal raster that it updates with output from the input string, assuming conservatively that the input could contain escapes that reposition the cursor arbitrarily.

All we need is to handle the colored output from rspec, cucumber, jasmine, and the other tools you know and love, and none of them monkey with the cursor .

We’ve casually tested ansible with input strings up to 64k, and we’re sure it can handle much more with quick turnaround.  Similar strings crushed ansi-sys.

At some point, we’ll compare performance between ansible and running chunks through ansi-sys.  For now, enjoy the pretty colors.

Post a Comment