0.14.3 • Published 9 months ago
@antfu/shiki v0.14.3
Usage
npm i shiki
const shiki = require('shiki')
shiki
.getHighlighter({
theme: 'nord'
})
.then(highlighter => {
console.log(highlighter.codeToHtml(`console.log('shiki');`, { lang: 'js' }))
})
// <pre class="shiki" style="background-color: #2e3440"><code>
// <!-- Highlighted Code -->
// </code></pre>
<script src="https://unpkg.com/shiki"></script>
<script>
shiki
.getHighlighter({
theme: 'nord'
})
.then(highlighter => {
const code = highlighter.codeToHtml(`console.log('shiki');`, { lang: 'js' })
document.getElementById('output').innerHTML = code
})
</script>
Clone shikijs/shiki-starter to play with Shiki, or try it out on Repl.it.
Learn more from the GitHub repo: shikijs/shiki.
Credits
- Shiki uses vscode-oniguruma
- A lot of code is based on vscode-textmate
Sponsorship
If you find Shiki useful, please consider sponsoring my Open Source development. Thank you 🙏
https://github.com/sponsors/octref
License
MIT © Pine Wu
0.14.3
9 months ago
0.6.2
3 years ago
0.5.0
3 years ago
0.6.1
3 years ago
0.6.0
3 years ago
0.5.2
3 years ago
0.4.3
3 years ago
0.4.2
3 years ago
0.4.1
3 years ago
0.4.0-alpha.4
3 years ago
0.4.0
3 years ago
0.4.0-alpha.3
3 years ago
0.4.0-alpha.2
3 years ago
0.4.0-alpha.1
3 years ago
0.3.5-alpha.0
3 years ago
0.3.4
3 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.3.3
3 years ago
0.3.0
3 years ago