You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decorations allow you to apply custom classes to specific lines in the generated HTML. This is useful if you want to style certain regions of your code blocks differently, such as focusing attention on specific lines or adding custom colors.
6
+
7
+
## Usage
8
+
9
+
To use decorations, you can pass a `LineDecoration` instance to the `PendingHtmlOutput::decoration()` method.
10
+
11
+
```php
12
+
use Phiki\Transformers\Decorations\LineDecoration;
This will add the `focus` class to the first line of the code block, since lines are zero-indexed.
22
+
23
+
## Substring decorations
24
+
25
+
At the time of writing, you can only decorate entire lines.
26
+
27
+
There are plans to support substring decorations in a future release, which will allow you to apply classes to specific parts of a line. This is quite an involved feature so it may take some time to implement.
0 commit comments