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. 

14 Comments
Great to have more support in the Croogo community!
I'll keep an eye out for your plugins as well.
Croogo is still young, but deserves to be used already.
------------------------------------------
name: PluginName
description: Integrates PluginName into Croogo
author: NA
authorEmail: NA
authorUrl: NA
---------------------------------
I'll probably create a repo at GitHub later today - and make a new post when it's ready.
Add new comment