Incorporating syntax highlighter to Boost theme

Incorporating syntax highlighter to Boost theme

by Femi Byte -
Number of replies: 4

Hi, I'm developing a programming course using Moodle. 

I am using the Boost theme.

I would like to incorporate any one of these syntax highlighters to display code:


Can someone advise how I can go about doing this ? I am a Moodle newbie.

Thanks for your suggestions.

Average of ratings: -
In reply to Femi Byte

Re: Incorporating syntax highlighter to Boost theme

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I've implemented the SyntaxHighlighter in my Shoelace theme as shown here: www.elearningworld.org/shoelace-an-undiscovered-theme/ - there is a link to the code so you can browse how I've implemented it.  However it is not a trivial task or easy to explain to a Moodle beginner as involves complex concepts.  But look / search at the setting 'syntaxhighlight' in the code and take things from there.

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Incorporating syntax highlighter to Boost theme

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You can use the Code Highlighter in the Generico filter. We used it for a programming course in Japan. 

https://moodle.org/mod/forum/discuss.php?d=339420

I actually submitted that (and a few other templates) to the plugins database recently. So it will have an official home soon. For now, install Generico and it is one of the presets already in the plugin.


Average of ratings: Useful (1)
In reply to Justin Hunt

Re: Incorporating syntax highlighter to Boost theme

by Alexander Bias -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I would not recommend to add any syntaxhighlighter to a theme because IMHO it's not the job of a theme to do this job.

If you are looking for an off-the-shelf solution, you might want to look at https://moodle.org/plugins/filter_syntaxhighlighter which adds highlight.js to Moodle and which works quite smoothly.

Average of ratings: Useful (2)