Markdown plugin for Croogo

I have been writing documentation for Croogo for the past few weeks in markdown format. The more I use it, the more I like it. It is really very nice to write in plain text and be able to convert it to proper (X)HTML when it is finally shown in the browser. So I decided to write a plugin for converting markdown to html. It can be used in Croogo for writing content, as well as manually in your CakePHP applications.

What is Markdown?

Markdown is a text-to-HTML conversion tool for web writers by John Gruber. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Learn more about markdown here: http://daringfireball.net/projects/markdown/.

I have used the PHP Markdown_Parser class by Michel Fortin for this plugin.

Download

Get the plugin from GitHub: http://github.com/fahad19/markdown.

How to use this plugin with Croogo?

Read the wiki for information on how to upload and activate the plugin. Once active, you can start writing content in markdown format.

You don't need to convert your already existing content (in HTML) into markdown because it is aware of what is already in HTML and won't convert them twice. It is recommended that you deactivate any WYSIWYG editors (like TinyMCE) before using this plugin.

Using the plugin in CakePHP applications manually

After placing the plugin at /app/plugins/markdown, let you Controller know to load the plugin's Helper:

<?php
class PostsController extends AppController {

    pubic $helpers = array('Markdown.Markdown');

}
?>

Now, in your views:

<?php
    // will output in HTML format
    echo $this->Markdown->transform($textInMarkdownFormat);
?>