jHighlight

Open Source Joomla Plugin

Joomla didn't provide any fancy syntax highlighter for code snippets, so I'm making a new one.

If you want to contribube go to the github project page

 

jHighlight

jHighlight is a Joomla plugin and syntax highlighter to help Joomla webmaster highlight code syntax.

It uses https://highlightjs.org/

Demo (63 skins): https://highlightjs.org/static/demo/

+1 Skin (Visual Studio Dark)

 

1. Installation

Download pkg_jhighlight_VERSION.zip.

Go into your Backend-> Extensions-> Extensions Manager-> Upload Package File and upload it.

 

2. Enable

Don't forget to enable it.

Go into your Backend-> Plugins-> System and enable "System - jHighlight"

 

3. How to use

<pre><code class="csharp">
    YOUR CODE HERE
</code></pre>

(Sometimes it's better to toogle the Editor off to insert a "raw" snippet)

There are currently 125 languages supported.

Css-class-names for those can be found here: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html

 

4. Example

using System;
namespace ConsoleApp1
{
    public class Program
    {
        public void Main(string[] args)
        {
            Console.WriteLine("Fibonacci on ASP.NET 5:");
            for (int i = 0; i < 15; i++)
            {
                Console.WriteLine(Fibonacci(i));
            }
    
            // keep console open
            Console.ReadLine();
        }
        public int Fibonacci(int n)
        {
            int a = 0;
            int b = 1;
            for (int i = 0; i < n; i++)
            {
                int temp = a;
                a = b;
                b = temp + b;
            }
            return a;
        }
    }
}

 

 

5. Skins

There are 64 skins to choose from. See here for reference: https://highlightjs.org/static/demo/

Go to Backend-> Plugins and open "System - jHighlight".

Choose a skin and press "Save & close"

 

Check it out and start contributing today:    GitHub jHighlight



Mahmut Jomaa is a Software Engineer from Germany.

Currently he attends university to gain more knowledge in Computer Science.


Security code Refresh