jeroen-g / textconveyor
Send any text over a conveyor to format it.
1.1
2018-04-26 19:39 UTC
Requires
- illuminate/container: ^5.6
- illuminate/pipeline: ~5
Requires (Dev)
- league/commonmark: ~0.17
- phpunit/phpunit: ~7.0
Suggests
- illuminate/support: This package provides a Laravel service provider.
- league/commonmark: This allows the use of the markdown formatter
This package is auto-updated.
Last update: 2024-12-25 08:28:05 UTC
README
The TextConveyor takes your text, whatever size, and runs it through a list of formatters that is defined by you.
Installation
Via Composer
$ composer require jeroen-g/textconveyor
In case you're using Laravel, a service provider and facade get registered automatically. With artisan vendor:publish
you can alter the formatters that get set in the config file.
Usage
$assembler = new JeroenG\TextConveyor\Assembler; $assembler->setFormatters([App\RemoveBadWords::class, App\LowercaseNames::class]); $assembler->addFormatter(App\CapitalizeNames::class); $assembler->removeFormatter(App\LowercaseNames::class); $formattedText = $assembler->sendContentThroughFormatters($content);
This is how it could be used in an Eloquent model:
public function getBodyAttribute($body) { return app(JeroenG\TextConveyor\Assembler::class)->sendContentThroughFormatters($body); }
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
License
license. Please see the license file for more information.