A PHP library that converts ANSI escape codes to HTML5 for displaying colored terminal output in web applications.
SensioLabs Ansi-to-Html is a PHP library that converts ANSI escape codes to HTML5 markup. It solves the problem of displaying colored terminal output, command-line results, or logs in web applications by transforming ANSI color and style sequences into browser-renderable HTML.
PHP developers building web applications that need to display terminal output, logs, or CLI results with preserved formatting and colors.
Developers choose this library for its simplicity, dedicated focus on ANSI-to-HTML conversion, and seamless integration with PHP projects and Twig templating, avoiding the need for complex custom parsing solutions.
An ANSI to HTML5 converter
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library has a single responsibility—converting ANSI to HTML—with no unnecessary dependencies, making it lightweight and easy to integrate, as emphasized in the philosophy section.
Supports built-in themes like Solarized and allows disabling inline styles for CSS class usage, providing flexibility in styling, as shown in the README examples.
Includes a Twig extension for seamless use in templating engines, simplifying ANSI output rendering in Symfony or Twig-based projects, demonstrated in the integration section.
Themes can generate CSS snippets via the asCss() method, enabling external stylesheet management and better separation of concerns, as illustrated in the code examples.
Limited to PHP environments; it cannot be used in other languages like JavaScript or Node.js without server-side processing, restricting its applicability in cross-platform projects.
The README only mentions built-in themes with no documentation on creating custom themes from scratch, which may hinder advanced styling needs.
Uses inline styles by default, which can conflict with project CSS strategies, and switching to CSS classes requires explicit configuration, adding complexity.