shiki
shiki
Last updated 4 years ago by octref .
MIT · Repository · Bugs · Original npm
$ cnpm install shiki 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.11.1                                ...           latest (3 years ago)
  • 0.9.4                                ...           next (4 years ago)

6 Versions

  • 0.9.15                                ...           4 years ago
  • 0.9.4                                ...           4 years ago
  • 0.11.1                                ...           3 years ago
  • 0.9.3                                ...           4 years ago
  • 0.0.3-next.3                                ...           7 years ago
  • 0.2.7                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org