Filters: GeSHi

filter_geshi
Maintained by Picture of Enovation Dev Team Enovation Dev Team
Color or highlight code snippets within Moodle resources
145 sites
62 downloads
3 fans

You can color or highlight code snippets within Moodle resources, forum posts etc. To do so you must install the GeSHi (Generic Syntax Highlighter) Filter. This makes the power of GeSHi available in Moodle through the use of a pair of special tags.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Picture of Enovation Dev Team
Enovation Dev Team (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Anthony Borrow
    Wed, 19 Mar 2014, 10:06 AM
    Many thanks for sharing this code with the Moodle community. I was wondering if you might provide some history about this plugin. It looks like it may have started with the code at http://geshi.org/downloads/moodle-geshi-filter-0.1.0.zip by Nigel McNie and then it looks like some work was done by David Mudrák at https://github.com/moodlehq/moodle-filter_geshi. Is Enovation taking the lead on this code?

    Also, please review http://docs.moodle.org/dev/Plugin_validation#Recommended_URLs and provide the source, tracker and documentation URLs. For documentation, might we want to use http://docs.moodle.org/26/en/Code_syntax_highlighting? If so, we should probably update it to match the instructions for usage in the README. If you have a moment, a screenshot would also be helpful.

    For now I am going to mark this as needing more work until we get the URLs worked out and documentation updated.

    I was able to successfully install and use the filter in Moodle 2.6. So once we get things tidied up we should be able to approve this.

    Peace - Anthony

    Peace - Anthony
  • Picture of David Mudrák
    Thu, 27 Mar 2014, 9:23 PM
    Correct, it was agreed between me and Tomasz Muras that Enovation would take the lead on maintaining this filter.

    I am not sure this needs more documentation than the one provided via README at the source control URL (which is added now). The old "Code syntax highlighting" could be improved and updated, for sure. But I do not see it as a blocker for approval, given that the filter works.
  • Picture of David Mudrák
    Thu, 27 Mar 2014, 9:32 PM
    OK, the page as is now is really confusing. Anthony is right - we need it updated before approving this plugin. It would be great if the new maintainers look at it.

    There is no actual code change from the version we use in production already, so the updated docs page would be a good sign that Enovation means it seriously with supporting this filter. Thanks in advance!
  • Anthony Borrow
    Wed, 9 Apr 2014, 10:08 AM
    Thanks for updating the URLs and the documentation. I think all is looking good and will go ahead and approve this. Peace - Anthony
  • Anthony Borrow
    Wed, 9 Apr 2014, 10:09 AM
    It is encouraged to follow Moodle's coding style as outlined in:

    http://docs.moodle.org/dev/Coding_style
    http://docs.moodle.org/dev/Coding

    Tthe code checker plugin can be quite helpful in fine tuning your code and can be found at:

    https://moodle.org/plugins/view.php?plugin=local_codechecker

    You may wish to consider using that tool to further improve your plugin. Below, are the initial results:

    filter/geshi/lang/en/filter_geshi.php - 2 error(s) and 0 warning(s)
    filter/geshi/version.php - 2 error(s) and 0 warning(s)
    filter/geshi/filter.php - 138 error(s) and 32 warning(s)
    filter/geshi/README.txt - 3 error(s) and 0 warning(s)
  • Picture of David Mudrák
    Tue, 6 May 2014, 6:11 AM
    Please note there is a mismatch between the $plugin->version declared in version.php and the version set in this directory. Please keep them in sync to avoid confusion.
  • Gmads
    Sat, 12 Jul 2014, 2:41 AM
    To add to the confusing and chaotic situation behind Geshi:
    https://moodle.org/mod/forum/discuss.php?d=240578
  • Picture of nivedita setru
    Mon, 19 Jan 2015, 8:09 PM
    The version number on download link doesn't match with version number within version.php file.
  • Picture of Alexei Barantsev
    Thu, 1 Sep 2016, 2:02 PM
    Is there a 3.1 compatible version?
  • Lina
    Fri, 18 Nov 2016, 4:37 PM
    Hi All,
    We are using the Moodle 3.1.
    I found that the Geshi filter code syntax highlight works fine by adding the "<" "code" ">"tag.
    But for the tag like "<""code css" ">" can only display the highlighting in the label activity or the description. In the activity content's text editor, this tag cannot work. Take the wiki activity as an example, if I put the code ".que .info .grade{display: none;}" into the wiki description and the wiki content, only the wiki description can display the code syntax highlighting. The wiki content text editor will clear the tag automatically and cannot show the highlighting.
    I just think this might be useful to other people, so I tried to share this here.
    Cheers, Lina
Please login to post comments