Synopsis
In writing posts like ‘ What a difference a character makes ’, I’ve been describing code, which on its own as plain text can be difficult to read as the structure and form are not immediately apparent. This is where ‘ Syntax highlighters ’ come in. Previously I’ve done this within the posts using screenshots, but recently the EnlighterJS plugin was added ( wordpress.org/plugins/enlighter ) to eLearningWorld and I updated all of my posts that contain code. This means that you’re now able to copy the code as you need using the plugins functionality.
My Foundation theme ( moodle.org/plugins/theme_foundation ) also has syntax highlighting functionality, as I wanted the student to be able to visualise the code their educator had written for them. This I see as especially important in a more technological world, where learning software engineering is a valuable skill. However it is restricted to the theme, what if you use another theme? Having completed ‘MoodleBites for Developers’ levels one and two courses ( www.moodlebites.com/mod/page/view.php?id=24546 and www.moodlebites.com/mod/page/view.php?id=19542 ) I was inspired to write a ‘ filter ’ to solve this problem as I’d not written one before.
And so I’ve created ‘SynHi’ ( github.com/gjb2048/moodle-filter_synhi ), a syntax highlighting filter, which in this post I will describe and explain the initial process of getting a plugin published on Moodle.org.
Link
Post link on eLearningWorld: SynHi .