Geshibot - Geshi Syntax Highlight Plugin/Mambot

Geshibot is a mambot for Mambo, plugin for Joomla, that highlights code within content items (articles).

Geshibot Support for Mambo

I haven't tested Geshibot 1.0.1Beta on Mambo, thought it should work on Mambo. If you use it on Mambo please let me know. Geshibot1.0 works well on Mambo.

Why Use Geshibot

As you may know, Joomla and Mambo now already have a bot called Geshi, that is used for highlighting PHP Syntax, or other language syntax. However, I found the Geshi Mambot/Plugin to be lacking quite a few features.
Geshibot, fills this in.

Geshibot Features:

  • Uses the Geshi Syntax Higlighting Class from Geshi Project
  • Allow highlighting of syntax in multiple formats, php, xml, html4strict, javascript, etc.
  • Show or not show line number.
  • Show fancy line numbers
  • Load Joomla/Mambo Styles into highlighted syntax (uses JavaScript to add Joomla CSS Classes)
  • Show a Pure Source Code Links that opens source in new window, with no formatting
  • Show links to function/element references in highlighting
  • Loads CSS Classes so you can define your own CSS if needed.
  • Allow Custom Header and Footer.

Geshibot Updates:

Version 1.0.1Beta:

  • Support for
    syntax, this allows geshibot to be used with WYSIWYG editors on or off.</li>
    <li>Allow syntax highlighting by defining a filename to get code from. This also comes with access restriction so that it can only be used with trusted users.</li>
    <li>Code Copy button or Copy Link Choice.</li>
    <li>A few code efficiency improvements.</li>
    </ul>
    </p>
    
    <p>
    <h4>How to use GeshiBot</h4>
    <p>In order for you to highlight Code you need to use the <pre></pre> tags or {geshibot}
    tags to encapsulate the code you need to highlight.

    The tag can take four (optional) parameters:
    filepath (or file) - a path to a file to highlight if you want to use this method. Otherwise you have to place the code in between the

     tags. This option is restriced to certain userlevels only using the "File Access" parameter. 
    language (or lang) - this can be php, html4strict, css, javascript, mysql, php-brief, text, xml
    header (or head) - Any Text that will display as the header
    footer (or foot) - Any text that will display as a footer

    You can also add more languages by adding the geshi language files into the:
    /joomla_site/mambots/geshibot/geshi/
    directory.

    Example Code Highlight Syntax Using Pre Tags:

    This will display as:

     

    // copy the code text to new window
    	function botgeshi_copy(_this) {
    		if (_this && _this.parentNode) {
    			var source = _this.parentNode.parentNode.nextSibling;
    			var name = source.className;
    			var _source = botgeshi_decode(source.innerHTML);
    			_source = '<textarea style="width: 100%; height: 100%;">'+html2entities(_source)+'</textarea>';
    			writeSourceWindow(_source, name, '[source view]');
    		}
    	}

    Note: You no longer have to disable your WYSIWYG editor to use geshibot. Just use the {geshibot} syntax instead of using the "pre" tag syntax.

    Example Code Highlight Syntax Using {geshibot} Tags:

    This will display as:

     

    // copy the code text to new window
    	function botgeshi_copy(_this) {
    		if (_this && _this.parentNode) {
    			var source = _this.parentNode.parentNode.nextSibling;
    			var name = source.className;
    			var _source = botgeshi_decode(source.innerHTML);
    			_source = '<textarea style="width: 100%; height: 100%;">'+html2entities(_source)+'</textarea>';
    			writeSourceWindow(_source, name, '[source view]');
    		}
    	}

    Download

    Geshibot is available from the Plugins/Mambots Section of Fiji Web Design.
    Plugins/Mambots Download Area

    Support

    This mambot is in 1.0.1 Beta. Please get back to me if you find bugs.
    For questions, feature requests and bugs email me.

 

Joomla Downloads

DownloadsDownload our free Joomla! Components, Modules and Plugins.