Add support for parsedown and parsedown-extra in symfony 2 by providing services and Twig filters.
PHP
Latest commit 6c06c5b Oct 29, 2014 Bgaze Corrected typos in bundle desc
Updated hompage in composer.json to github repo url
Permalink
Failed to load latest commit information.
DependencyInjection Initial commit Oct 29, 2014
Resources/config Initial commit Oct 29, 2014
Twig Initial commit Oct 29, 2014
.gitignore
BgazeParsedownBundle.php Initial commit Oct 29, 2014
LICENSE
README.md
composer.json

README.md

Bgaze Parsedown Bundle

Add support for parsedown and parsedown-extra in Symfony 2.

Provides :

  • Two services:
    • parsedown.standart : parsedown parser.
    • parsedown.extra : parsedown-extra parser (support for Markdown Extra).
  • Two twig filter:
    • md : parse markdown with standart parser.
    • mde : parse markdown with extra parser.

Install

Add the bundle in your composer.json :

"require": {
    "bgaze/parsedown-bundle": "dev-master"
}

Update your vendors, then enable bundle in AppKernel.php :

new Bgaze\ParsedownBundle\BgazeParsedownBundle(),

Usage

In twig templates:

{# Parse markdown using parsedown standart parser #}
{{ var|md }}

{# Parse markdown using parsedown-extra parser #}
{{ var|mde }}

In PHP :

// Parse markdown using parsedown standart parser.
echo $container->get('parsedown.standart')->text($var);

// Parse markdown using parsedown-extra parser.
echo $container->get('parsedown.extra')->text($var);