@@ -88,6 +88,16 @@ export function foo() {
8888
8989Use ` [!code highlight] ` to highlight a line (adding ` highlighted ` class).
9090
91+ ```` md
92+ ```ts
93+ export function foo() {
94+ console.log('Highlighted') // [\!code highlight]
95+ }
96+ ```
97+ ````
98+
99+ Results in
100+
91101``` ts
92102export function foo() {
93103 console .log (' Highlighted' ) // [!code highlight]
@@ -98,10 +108,62 @@ Alternatively, you can use the [`transformerMetaHighlight`](#transformermetahigh
98108
99109---
100110
111+ ### ` transformerNotationWordHighlight `
112+
113+ Use ` [!code word:xxx] ` to highlight a word (adding ` highlighted-word ` class).
114+
115+ ```` md
116+ ```ts
117+ export function foo() { // [\!code word:Hello]
118+ const msg = 'Hello World'
119+ console.log(msg) // prints Hello World
120+ }
121+ ```
122+ ````
123+
124+ Results in
125+
126+ ``` ts
127+ export function foo() { // [!code word:Hello]
128+ const msg = ' Hello World'
129+ console .log (msg ) // prints Hello World
130+ }
131+ ```
132+
133+ You can also specify the number of occurrences to highlight, e.g. ` [!code word:options:2] ` will highlight the next 2 occurrences of ` options ` .
134+
135+ ```` md
136+ ```ts
137+ // [\!code word:options:2]
138+ const options = { foo: 'bar' }
139+ options.foo = 'baz'
140+ console.log(options.foo) // this one will not be highlighted
141+ ```
142+ ````
143+
144+ ``` ts
145+ // [!code word:options:2]
146+ const options = { foo: ' bar' }
147+ options .foo = ' baz'
148+ console .log (options .foo ) // this one will not be highlighted
149+ ```
150+
151+ ---
152+
101153### ` transformerNotationFocus `
102154
103155Use ` [!code focus] ` to focus a line (adding ` focused ` class).
104156
157+ ```` md
158+ ```ts
159+ export function foo() {
160+ console.log('Focused') // [\!code focus]
161+ }
162+ ```
163+ ````
164+
165+ Results in
166+
105167``` ts
106168export function foo() {
107169 console .log (' Focused' ) // [!code focus]
@@ -114,6 +176,17 @@ export function foo() {
114176
115177Use ` [!code error] ` , ` [!code warning] ` , to mark a line with an error level (adding ` highlighted error ` , ` highlighted warning ` class).
116178
179+ ```` md
180+ ```ts
181+ export function foo() {
182+ console.error('Error') // [\!code error]
183+ console.warn('Warning') // [\!code warning]
184+ }
185+ ```
186+ ````
187+
188+ Results in
189+
117190``` ts
118191export function foo() {
119192 console .error (' Error' ) // [!code error]
@@ -181,6 +254,25 @@ console.log('3')
181254console .log (' 4' )
182255```
183256
257+ ### ` transformerMetaWordHighlight `
258+
259+ Highlight words based on the meta string provided on the code snippet. Requires integrations supports.
260+
261+ ```` md
262+ ```js /Hello/
263+ const msg = 'Hello World'
264+ console.log(msg)
265+ console.log(msg) // prints Hello World
266+ ```
267+ ````
268+
269+ Results in
270+
271+ ``` js /Hello/
272+ const msg = ' Hello World'
273+ console .log (msg) // prints Hello World
274+ ```
275+
184276---
185277
186278### ` transformerCompactLineOptions `
0 commit comments