Highlight.js highlights syntax in code examples on blogs, forums and in fact on any web pages. It's very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.
Dependencies
Libraries API
highlight.js
Installation
- Download the module and place it in the sites/all/modules directory
- Download the highlight.js library and place it in the sites/all/libraries and rename it to highlightjs.
- Enable highlight js and highlight js filter module.
- Enable the filter setting for the filter format.
Usage
Use <code> to output code in a given language. In this case the library will try to detect the language automatically.
OR
Use <code lang="css"> to output code in a given language.
To disable highlighting of a fragment altogether use "no-highlight" class.
<code class="no-highlight">
Project information
- Module categories: Content Editing Experience, Content Display
- 100 sites report using this module
- Created by junedkazi on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 7.x-1.x-dev updated 6 Jul 2016 at 20:22 UTC