Skip to content

rennomarcus/ember-highlightjs-shim

Repository files navigation

ember-highlightjs-shim

Build Status

Shim to use the terrific library highlight.js to highlight code.

Installation

  • ember install ember-highlightjs-shim

Usage

Once installed, you can import the module hljs as an AMD module with:

import hljs from 'highlight';

Then use like the code below, for example:

didRender() {
  this._super(...arguments);
  hljs.initHighlighting.called = false;
  hljs.initHighlighting();
}

You can import a theme in your config/environment. Example of how to import a theme in your ENV object:

let ENV = {
  highlightTheme: 'atom-one-dark'
}

The default theme is 'atom-one-dark'. You can find the list of themes here

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server