Download the PHP package whatsdiff/chewie without Composer
On this page you can find all versions of the php package whatsdiff/chewie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download whatsdiff/chewie
More information about whatsdiff/chewie
Files in whatsdiff/chewie
Package chewie
Short Description whatsdiff's fork of joetannenbaum/chewie — a PHP TUI framework built on Laravel Prompts
License
Informations about the package chewie
[!WARNING] This is a fork. You almost certainly want
joetannenbaum/chewieinstead. This repository exists to serve whatsdiff and is not a general-purpose release of Chewie.It tracks upstream
mainwith two changes:
Output\Linesmeasures columns withmb_strwidth()instead ofmb_strlen(). Emoji and CJK characters count as one character but occupy two terminal cells, so a column containing them was under-padded and the column beside it drifted out of alignment.- The hardcoded
versionfield is gone fromcomposer.json, so Composer can read the version from the tag rather than rejecting any tag that disagrees with the manifest.Both are meant to go upstream. If they land there, this fork goes away.
Chewie
Chewie is a package that helps you build text-based user interfaces (TUIs) with Laravel Prompts. It helps to reduce some of the boilerplate code and adds some helpers for alignment, animation, and more.
[!WARNING] This package is currently in active development. The API is subject to change. Documentation will also improve over time.
Installation
Registering Renderers
You can also tell Chewie that all of your renderers live within a specific namespace, then Chewie will resolve your renderers automatically.
For example, if you call the following in your AppServiceProvider:
Then you can simply do the following when registering renderers. Chewie assumes your renderer class will be your app class + Renderer:
Drawing Art
You can easily print ASCII art from a file out to the terminal in your renderer:
You can also tell Chewie where all of your art files live:
which allows you to simplify the artLines call to:
Alignment
Chewie comes with methods that help align content within the terminal.