2017 © Pedro Peláez
 

library formatting

Manipulate styles in Maniaplanet strings.

image

manialib/formatting

Manipulate styles in Maniaplanet strings.

  • Monday, June 19, 2017
  • by magnetik
  • Repository
  • 3 Watchers
  • 0 Stars
  • 807 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 8 % Grown

The README.md

Manialib\Formatting

Manialib\Formatting is a PHP package for manipulating styles in Maniaplanet strings., (*1)

Learn more about Maniaplanet formatting characters on the wiki., (*2)

Beta

Build Status Packagist Version Total Downloads SensioLabs Insight, (*3)

This is a work in progress. As long as we don't release a stable version, we might break stuff at any point. If this is a problem, feel free to open an issue and we'll try to help., (*4)

Features

  • Strip styles from strings: links, colors, etc.
  • Convert strings to other formats: HTML for now

Find out more in the change log., (*5)

Requirements

  • PHP 8.1+

Installation

Install via Composer:, (*6)

{
    "require": {
        "manialib/formatting": "^4.0"
    }
}

Usage

Modify styles of a string:, (*7)

Note the String fluent interface which allows to chain method calls, (*8)

use Manialib\Formatting\ManiaplanetString;

$nickname = '$l[https://github.com/manialib/formatting]$cfeg$fff๐u1 $666ツ$l';

$string = new ManiaplanetString($nickname);
echo $string->stripColors()->stripLinks();

Will output:, (*9)

g๐u1 ツ

Convert a string to HTML:, (*10)

use Manialib\Formatting\ManiaplanetString;

$string = new ManiaplanetString('$cfeg$fff๐u1 $666ツ');

echo $string->toHtml();

Will output:, (*11)

<span style="color:#cfe;">g</span><span style="color:#fff;">๐u1 </span><span style="color:#666;">ツ</span>

Everything you need for using this should be documented in Manialib/Formatting/StringInterface., (*12)

Tests

$ php vendor/bin/phpunit, (*13)

$ php vendor/bin/phpcs --standard=PSR2 src, (*14)

Development guidelines

We follow best practices from the amazing PHP ecosystem. Warm kudos to Symfony, The PHP League, the PHP subreddit and many more for inspiration and challenging ideas., (*15)

The Versions

19/06 2017

dev-master

9999999-dev https://github.com/manialib/formatting

Manipulate styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo

19/06 2017

4.0.2

4.0.2.0 https://github.com/manialib/formatting

Manipulate styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo

09/06 2017

4.0.1

4.0.1.0 https://github.com/manialib/formatting

Manipulate styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo

08/06 2017

4.0

4.0.0.0 https://github.com/manialib/formatting

Manipulate styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo

03/02 2015

4.0.0-beta2

4.0.0.0-beta2 https://github.com/manialib/formatting

Manipulate styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo

29/01 2015

v4.0-beta

4.0.0.0-beta https://github.com/manialib/formatting

A simple PHP component for manipulating styles in Maniaplanet strings.

  Sources   Download

MIT

The Requires

 

The Development Requires

maniaplanet shootmania trackmania manialib ubisoft nadeo