Markitup and highlighter plugins for croogo
I implemented two plugins for Croogo: a Markitup plugin and a syntax highlighting plugin.
They are not finished yet, but in a usable state already - I use both of them to write this post. 
The highlighter plugin is very simple indeed, only a helper:
class HighlighterHookHelper extends AppHelper {
/**
* Other helpers used by this helper
*
* @var array
* @access public
*/
var $helpers = array(
'Html',
'Js',
);
/**
* Before render callback. Called before the view file is rendered.
*
* @return void
*/
function beforeRender() {
echo $this->Html->css('/highlighter/css/shCore');
echo $this->Html->css('/highlighter/css/shThemeRDark');
echo $this->Html->script('/highlighter/js/shCore.js');
echo $this->Html->script('/highlighter/js/shBrushBash.js');
echo $this->Html->script('/highlighter/js/shBrushCSharp.js');
echo $this->Html->script('/highlighter/js/shBrushCpp.js');
echo $this->Html->script('/highlighter/js/shBrushCss.js');
echo $this->Html->script('/highlighter/js/shBrushDelphi.js');
echo $this->Html->script('/highlighter/js/shBrushDiff.js');
echo $this->Html->script('/highlighter/js/shBrushJScript.js');
echo $this->Html->script('/highlighter/js/shBrushPerl.js');
echo $this->Html->script('/highlighter/js/shBrushPhp.js');
echo $this->Html->script('/highlighter/js/shBrushPlain.js');
echo $this->Html->script('/highlighter/js/shBrushPowerShell.js');
echo $this->Html->script('/highlighter/js/shBrushPython.js');
echo $this->Html->script('/highlighter/js/shBrushRuby.js');
echo $this->Html->script('/highlighter/js/shBrushScala.js');
echo $this->Html->script('/highlighter/js/shBrushSql.js');
echo $this->Html->script('/highlighter/js/shBrushVb.js');
echo $this->Html->script('/highlighter/js/shBrushXml.js');
echo $this->Html->scriptBlock("
SyntaxHighlighter.config.clipboardSwf = '/highlighter/js/clipboard.swf';
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.defaults['wrap-lines'] = true;
SyntaxHighlighter.all();
");
}
}
I use a Code button and a Encode HTML characters button in the Markitup editor, and it works great.
I like that the editor doesn't mess around with the code / markup behind my back.
Markitup is a jQuery powered markup editor, which is very configurable and low impact - highly recommended.
It looks like this in action:
You can download both plugins here:
Though I hope that it will become included in Croogo, at least the Markitup plugin 
I am totally new to jQuery, and haven't implemented the file upload hook for the Markitup plugin yet.
If anyone implements that, I'll be happy to update the download.
And the highlighter plugin could do with a proper options 'screen', instead of requiring you to hack the helper script to use a different theme.
And the editor does currently only spit out a 'php' code tag..
So, obviously: To be continued. 


Mar 26, 2010
Mar 26, 2010
Apr 13, 2010
To make these work with Croogo 1.3 I needed to create a "plugin.yml" file in the webroot directory. Example below:
------------------------------------------
name: PluginName
description: Integrates PluginName into Croogo
author: NA
authorEmail: NA
authorUrl: NA
---------------------------------
Apr 14, 2010
Apr 14, 2010
Apr 14, 2010
Apr 15, 2010
Apr 15, 2010