Turbolinks 5 compatible fork of Highlight.js
OTHER License
This is a Turbolinks 5 compatible fork of Highlight.js, and is up to date with v9.12.0.
To make Highlight.js compatible with Turbolinks 5, two event
listeners have been added to initHighlightingOnLoad
, which
listen for the turbolinks:load
and turbolinks:render
events.
The original event listeners used by initHighlightingOnLoad
have been left in place. They listen for the DOMContentLoaded
and load
events. This allows highlight-js-turbolinks
to be compatible with applications that use turbolinks,
and also compatable with applications that do not. Therefore
if you ever choose to disable or remove turbolinks from
your application, you may continue to use highlightjs-turbolinks
.
Coming soon!
From your Rails root, run
yarn add highlightjs-turbolinks
Then add the following line to app/assets/javascripts/application.js
//= require highlightjs-turbolinks/lib/highlightjs-turbolinks.js
Then add the following line to app/assets/stylesheets/application.css
*= require highlightjs-turbolinks/styles/default.css
Highlightjs-turbolinks is released under the BSD License. See LICENSE file for details.
The official site for the original library is at https://highlightjs.org/.
Further in-depth documentation for the API and other topics is at http://highlightjs.readthedocs.io/.
Authors and contributors are listed in the AUTHORS.en.txt file.