@nkduy/syntax
TypeScript icon, indicating that this package has built-in type declarations

0.10.1-alpha.1 • Public • Published

NKDuy Syntax

Usage

npm i @nkduy/syntax
# yarn add @nkduy/syntax
const syntax = require('@nkduy/syntax')

syntax
  .getHighlighter({
    theme: 'nord'
  })
  .then(highlighter => {
    console.log(highlighter.codeToHtml(`console.log('syntax');`, { lang: 'js' }))
  })

// <pre class="nkd-syntax" style="background-color: #2e3440"><code>
//   <!-- Highlighted Code -->
// </code></pre>
<script src="https://unpkg.com/@nkduy/syntax"></script>
<script>
  syntax
    .getHighlighter({
      theme: 'nord'
    })
    .then(highlighter => {
      const code = highlighter.codeToHtml(`console.log('syntax');`, { lang: 'js' })
      document.getElementById('output').innerHTML = code
    })
</script>

License

MIT

Package Sidebar

Install

npm i @nkduy/syntax

Weekly Downloads

19

Version

0.10.1-alpha.1

License

MIT

Unpacked Size

8.43 MB

Total Files

228

Last publish

Collaborators

  • nkduy