Socket
Socket
Sign inDemoInstall

highlightjs-turbolinks

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    highlightjs-turbolinks

Turbolinks compatible syntax highlighting with language autodetection.


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Build Status

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.

Installing with Yarn and Rails

For Rails 5

Coming soon!

For Rails 5.1 and up

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

License

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.

Keywords

FAQs

Last updated on 29 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc