Skip to content

Commit 6d4bcd1

Browse files
committed
chore: update readme.md
1 parent afcdb47 commit 6d4bcd1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -419,27 +419,30 @@ Use this option to transform the highlighted code block with Shiki's [Transforme
419419
```js
420420
import posthtml from 'posthtml'
421421
import shiki from 'posthtml-shiki'
422+
import { transformerNotationHighlight } from '@shikijs/transformers'
422423

423424
posthtml([
424425
shiki({
425426
transformers: [
427+
transformerNotationHighlight(),
426428
{
427429
code(node) {
428-
this.addClassToHast(node, 'language-js')
430+
this.addClassToHast(node, 'custom-class')
429431
},
430-
}
432+
},
431433
]
432434
})
433435
])
434436
.process(`
435437
<shiki>
436438
const foo = 'bar'
439+
let baz = 'biz' // [!code highlight]
437440
</shiki>
438441
`)
439442
.then(result => result.html)
440443
```
441444

442-
The generated `<code>` tag will have the `language-js` class added.
445+
See the docs for [Shiki Transformers](https://shiki.style/guide/transformers) and a list of [common Shiki Transformers](https://shiki.style/packages/transformers).
443446

444447
[npm]: https://www.npmjs.com/package/posthtml-shiki
445448
[npm-version-shield]: https://img.shields.io/npm/v/posthtml-shiki.svg

0 commit comments

Comments
 (0)