How to use Syntax Highlighting GitBook


I’m new to GitBook and I am trying to make the syntax highlight work as expected for some JavaScript lines of code.

some javascript lines without colour

I noticed that there is a plugin store in the editor. I enabled a plugin called highlight but it’s not doing it’s job.

I searched in the documentation for this, but I couldn’t find anything related.

This book has the syntax highlighting enabled and working:


    "plugins": [
    "pluginsConfig": {}

How can I do the same?


If you are writing GitBook pages in Markdown, you can highlight your code like below:

var foo = function(num) {
    return num + num;

Where ‘javascript’ can be replaced with other languages, such as ‘python’, ‘java’, ‘c’ etc.

Answered By – swen

Answer Checked By – Marilyn (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.