PHP-Console-Color icon indicating copy to clipboard operation
PHP-Console-Color copied to clipboard

Documentation does not say what this package does

Open edgreenberg opened this issue 7 years ago • 4 comments

I inherited this package as part of an existing project that was started in Laravel 5.3. We're reviewing packages, and I discovered that no documentation I can find explains what this package does. I checked Packagist.org, and this git repo. It'd be nice to understand a bit about why this package is useful.

Thank you.

edgreenberg avatar Jan 05 '18 13:01 edgreenberg

Yes. I also have the same issue here. There is no official doc to know how to use this package.

peter279k avatar Jul 02 '18 02:07 peter279k

I am not good documentation guy, so at least I added image and link to example.php file. But pull requests are welcome!

JakubOnderka avatar Sep 29 '18 17:09 JakubOnderka

Hi @JakubOnderka, thank you for your reply. Do you mind I add some docs for improving example.php?

I plan to create the official doc like that. Thanks.

peter279k avatar Sep 30 '18 19:09 peter279k

Well, I saw the state of this project two days ago, and, well, I think the interface for this library could use some MAJOR refactoring. A total rewrite, actually. So that's what I did!

https://github.com/phpexpertsinc/ConsolePainter

Its fluent interface lets you effortlessly create complex console formatting:

// This is *REALLY* emphasized!
echo $p->italics('This is ') .
    $p->bold('*') . $p->bold()->underlined()->yellow('*REALLY*') .
    $p->bold()->onLightBlue(' emphasized*') . '!' . "\n";

echo $p->yellow('Press ')->bolder()->red('ENTER')->yellow(' to continue...') . "\n";

// Draw the Red, White and Blue:
echo $p->bolder()->red('Red')->dim(', ')->italics()->white('White ')->dim('and ')->blue('Blue') . "\n";

image

You can even create ASCII art, like this derivation of the EU logo:

EU Logo ASCII Art

hopeseekr avatar Jun 15 '19 23:06 hopeseekr