All Projects → shikijs → Shiki

shikijs / Shiki

A beautiful Syntax Highlighter.

Programming Languages

typescript
32286 projects

Shiki

Shiki is a beautiful Syntax Highlighter. Demo.

Usage

npm i shiki
# yarn add shiki
const shiki = require('shiki')

shiki
  .getHighlighter({
    theme: 'nord'
  })
  .then(highlighter => {
    console.log(highlighter.codeToHtml(`console.log('shiki');`, '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');`, 'js')
    document.getElementById('output').innerHTML = code
  })
</script>

Clone shikijs/shiki-starter to play with Shiki, or try it out on Repl.it.

Seen

Contributing

Credits

Sponsorship

If you find Shiki useful, please consider sponsoring my Open Source development. Thank you 🙏

https://github.com/sponsors/octref

License

MIT © Pine Wu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].