Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Félix Dorn committed Mar 14, 2024
1 parent 9d0e1c8 commit 3bb42c7
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,39 @@ you are just looking to change the colors.

## Outputs

* [`Felix\Tin\Themes\AnsiOutput`](src/Outputs/AnsiOutput.php)
* **ANSI** [`Felix\Tin\Themes\AnsiOutput`](src/Outputs/AnsiOutput.php)

```php
$tin = new \Felix\Tin\Tin(
new \Felix\Tin\Outputs\AnsiOutput()
)
```

* **HTML** [`Felix\Tin\Themes\HtmlOutput`](src/Outputs/HtmlOutput.php)

```php
$tin = new \Felix\Tin\Tin(
new \Felix\Tin\Outputs\HtmlOutput()
)
```

* [`Felix\Tin\Themes\CallableOutput`](src/Outputs/CallableOutput.php)
* [`Felix\Tin\Themes\HtmlOutput`](src/Outputs/HtmlOutput.php)

Callable output is best used in combination with the ANSI or HTML output, you can think of it as a sort of decorator
when you need change a small thing without creating a class.

```php
$tin = new \Felix\Tin\Tin(
new \Felix\Tin\Outputs\CallableOutput(
new \Felix\Tin\Themes\OneDark(),
fn (\Felix\Tin\Line $line) => $line->number % 2 ? (new \Felix\Tin\Outputs\AnsiOutput())->transformLine($line) : null
)
)
```

## Themes

Themes define the colors used by outputs. The format is `r;g;b`, to match ANSI default format.
Themes define the colors used by outputs. The format is `r;g;b`, to match the default ANSI format.

* [`Felix\Tin\Themes\JetbrainsDark`](src/Themes/JetbrainsDark.php)
* [`Felix\Tin\Themes\OneDark`](src/Themes/OneDark.php)
Expand Down

0 comments on commit 3bb42c7

Please sign in to comment.