From 780cfa4915d6fd8718572591e01fdf0b803a08f2 Mon Sep 17 00:00:00 2001 From: Chris Morrell Date: Wed, 17 Apr 2024 15:32:45 -0400 Subject: [PATCH] Release notes --- CHANGELOG.md | 10 +++++++++- README.md | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b34b9f8..442d0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,15 @@ format. This project adheres to [Semantic Versioning](https://semver.org/spec/v2 ## [0.0.1] - 2024-04-17 -## [0.0.1] +### Added + +- Added support for `length` (number of chars) and `width` (multibyte width of chars) +- Added support for `prepend` and `append` +- Added support for `startsWith` and `endsWith` +- Added support for `padLeft`, `padRight`, and `padBoth` +- Added support for `wordwrap` +- Added support for `explode` +- Added support for `is` (for comparing two ansi strings) # Keep a Changelog Syntax diff --git a/README.md b/README.md index cfa3a31..97c2725 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,29 @@ -# AnsiPants 👖💫 +# ANSI Pants 👖💫 ## Installation +```shell +composer require glhd/ansipants +``` + ## Usage +You can instantiate a new ANSI string using the `ansi()` helper, with `new AnsiString()`, +or with `AnsiString::make()`. All string manipulation functions can be chained, just like +the Laravel `Stringable` class. Where appropriate, you can pass an additional `ignore_style: true` +argument into a function to make that function ignore the ANSI styles that are applied +(like color or font style). + +An example: + ```php ansi("\e[1mHello💥 \e[3mwo\e[0mrld") ->append(" 🥸🥸🥸") ->padLeft(100) - ->wordWrap(); + ->wordwrap(); ``` ## Resources