GFM-like Markdown in PHP: Syntax Highlighting with Sundown and Pygments in Symfony2
I've just finished work on VarspoolPygmentsModule, a Symfony2 Bundle that lets you render Markdown with beautiful code examples. A huge list of languages are supported.
It reuses an existing Sundown module for the initial Markdown rendering. It even provides inline syntax-highlighting of php code (no need for <?php
):
# app/autoload.php
$loader->registerNamespaces(array(
// [...]
'Varspool' => __DIR__.'/../vendor/bundles',
'Kwattro' => __DIR__.'/../vendor/bundles'
));
# app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Kwattro\MarkdownBundle\KwattroMarkdownBundle(),
new Varspool\PygmentsBundle\VarspoolPygmentsBundle(),
);
}
This is it in action, of course :-).