Blooki
Grow what you know
Home
>
development
>
Markdown Integration
Title
Modification Date
Text
Even though Blooki currently provides "Textile":http://search.cpan.org/~tomi/Text-Textile-0.6/, Tiki and ConvertBreaks filters, I've been thinking about adding "Markdown":http://daringfireball.net/2004/08/markdown_10 as several people asked me about it. Markdown is a perl module, so I didn't expect any troubles integrating it with Blooki. There were few challenges though both related to the fact that Markdown is not distributed as a Perl module; instead it's distributed as a Perl script. First, since it can run as a script and as a plugin for MovableType and Blosxom it checks if either of those is avaiable and if not, it waits for input to be processed. This is easily fixable by changing <code>defined($blosxom::version)</code> (line 184 in Markdown 1.0) to something like <code>(caller(0))[7]</code>, which returns true if the script was called using use/require/do. Second, the old IfModule directive in a config file only processesed "real" modules/packages, and not files. So I extended it to accept files and Perl versions (as Markdown requires Perl 5.6 and later). Now the fragment that loads Markdown looks like the following: <pre><code> <IfModule 5.006 Markdown.pl> # Markdown requires Perl 5.006 AddModule Markdown </IfModule> </code></pre> This goes into Blooki 0.48.