$ account thephpleague
This is a PHP library that converts HTML strings to Markdown. It parses HTML into a DOMDocument, then recursively traverses the DOM tree, converting each node to its Markdown equivalent using a registry of converter classes. The architecture is clean: an `HtmlConverter` orchestrates the process, an `Environment` manages configuration and converter registration, and individual converter classes handle specific HTML elements (headers, links, lists, tables, etc.). The library supports extensive configuration options including stripping tags, preserving comments, customizing emphasis styles, and enabling table conversion. It provides both a programmatic API and a CLI binary. The code is well-structured with strict typing, interfaces, and comprehensive test coverage. It demonstrates solid software engineering practices and is actively maintained.
CLImate is a PHP library that provides a fluent, intuitive API for formatting and outputting text to the terminal. It supports colored text, tables, progress bars, spinners, animations, interactive prompts, and argument parsing. The library abstracts away platform-specific differences (Linux vs. Windows, ANSI vs. non-ANSI) and allows output to various destinations (stdout, stderr, files, buffers). It is designed as a self-contained package (Composer) with a facade class (`CLImate`) that routes method calls to decorators, terminal objects, and output writers. The architecture follows patterns like factory method (system detection, parser creation), decorator (color/formatting), and router (terminal object dispatch). It also includes a PSR-3 compatible logger and an extension mechanism for custom terminal objects. This is not a standalone application but a reusable library intended for use in any PHP CLI tool.