@episodeyang/react-highlight.js

A lightweight React wrapper around the Highlight.js syntaxt highlighting library

Usage no npm install needed!

<script type="module">
  import episodeyangReactHighlightJs from 'https://cdn.skypack.dev/@episodeyang/react-highlight.js';
</script>

README

Demo

See the demo here.

Installation

Install @episodeyang/react-highlight.js using NPM:

npm install @episodeyang/react-highlight.js --save

Choose a highlight.js theme and make sure it's included in your index file.

<link rel='stylesheet' href='https://highlightjs.org/static/demo/styles/railscasts.css'/>

And then use @episodeyang/react-highlight.js to display your text like so:

<Highlight language={language}>
  {content}
</Highlight>

License

@episodeyang/react-highlight.js is available under the MIT License.