Fast Faq

Fast Faq


Use syntax highlighter HighLight.js on your magento frontend store.

  • Free extension.
  • 30 seconds install.
  • 166 available languages (HTML, PHP, XML, CSS, LESS, Javascript, JSON etc... ).
  • 77 css styles to format code the way you like.

html sample

<!DOCTYPE html>

<style>body {width: 500px;}</style>

<script type="application/javascript">
  function $init() {return true;}

  <p checked class="title" id='title'>Title</p>
  <!-- here goes the rest of the page -->

JavaScript sample

require([ 'jquery'], function($){ $(document).ready(function($) {
    $(window).load(function() {
            $('pre code').each(function(i, block) {
}); });
Where can I see available styles ?
You wil lfind all styles and supported languages on HighLight.js demo page
How do I change style ?
Just change style in the following file :
Replace monokai-sublime.css with the style that you want to use.

<!-- /app/code/Netgasoline/Highlightjs/view/frontend/layout/default.xml -->
<?xml version="1.0"?>
<page xmlns:xsi="" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
        <script src="Netgasoline_Highlightjs::js/highlight.js"/>
        <script src="Netgasoline_Highlightjs::js/highlight.pack.js"/>
        <css src="Netgasoline_Highlightjs::css/styles/monokai-sublime.css"/>
How to place code ?
You have to place your code inside those tags in order to highlight your code:
<pre><code class="Language"></code></pre>
<pre><code class="xml">
<!-- Your code here -->

Install with Composer

  • Open your command line interface
  • Use "cd" to navigate to the root of your shop installation
  • Run this command:
    composer require GeromeF/Highlightjs

Install with archive file

  • Download from GitHub
  • Unzip the archive
  • Create directory app/code/Netgasoline/Highlightjs
  • Copy files into this new directory

Enable the extension

  • Open your command line interface
  • Use "cd" to navigate to the root of your magento store installation
  • Run the following commands
    php bin/magento module:enable Netgasoline_Highlightjs
    php bin/magento setup:upgrade
Write Your Own Review
You're reviewing:HighLight.js
Your Rating