File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,15 @@ use Ahc\CliSyntax\Highlighter;
100100// PHP code
101101echo new Highlighter('<?php echo "Hello world!";');
102102// OR
103- echo (new Highlighter)->highlight('<?php echo "Hello world!";');
103+ echo (new Highlighter)->highlight('<?php echo "Hello world!";', $options );
104104
105105// PHP file
106- echo Highlighter::for('/path/to/file.php');
106+ echo Highlighter::for('/path/to/file.php', $options);
107+
108+ // $options array is optional and can contain:
109+ [
110+ 'lineNo' => true, // bool
111+ ];
107112```
108113
109114#### Export
@@ -112,7 +117,14 @@ echo Highlighter::for('/path/to/file.php');
112117use Ahc\CliSyntax\Exporter;
113118
114119// PHP file
115- Exporter::for('/path/to/file.php')->export('file.png');
120+ Exporter::for('/path/to/file.php')->export('file.png', $options);
121+
122+ // $options array is optional and can contain:
123+ [
124+ 'lineNo' => true, // bool
125+ 'font' => 'full/path/of/font.ttf', // str
126+ 'size' => 'font size', // int
127+ ];
116128```
117129
118130See [ example usage] ( ./example.php ) . Here's how the export looks like:
You can’t perform that action at this time.
0 commit comments