Skip to content

Commit d91624f

Browse files
committed
docs: add export usage
1 parent eb2ef0f commit d91624f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ composer require adhocore/cli-syntax
1414
```
1515

1616
## Usage
17+
18+
You can either highlight PHP code in CLI or export to png image.
19+
20+
### Highlight
21+
1722
```php
1823
use Ahc\CliSyntax\Highlighter;
1924

@@ -26,9 +31,18 @@ echo (new Highlighter)->highlight('<?php echo "Hello world!";');
2631
echo Highlighter::for('/path/to/file.php');
2732
```
2833

29-
See [example](./example.php). Here's the screenshot too:
34+
### Export
35+
36+
```php
37+
use Ahc\CliSyntax\Exporter;
38+
39+
// PHP file
40+
Exporter::for('/path/to/file.php')->export('file.png');
41+
```
42+
43+
See [example usage](./example.php). Here's how the export looks like:
3044

31-
![adhocore/cli-syntax](https://imgur.com/wcNp3qJ.png)
45+
![adhocore/cli-syntax](./example.png)
3246

3347
## Contributing
3448

0 commit comments

Comments
 (0)