kalmanolah/markdownbundle

Markdown/Parsedown bundle for Symfony2 providing a service and a twig filter

dev-master / 2.4.x-dev 2014-05-24 21:10 UTC

This package is not auto-updated.

Last update: 2020-01-24 15:23:30 UTC


README

Markdown/Parsedown bundle for Symfony2 providing a service and a twig filter

Installation

Just add this to your composer.json:

...
"require": {
    ...
    "kalmanolah/markdownbundle": "*@dev",
    ...
}
...

Afterwards, enable the bundle in your AppKernel.php like so:

$bundles = array(
    ...
    new KalmanOlah\MarkdownBundle\KalmanOlahMarkdownBundle(),
);

Usage

Using the service:

// Assuming you have a container handy
echo $this->get('markdown')->text('**Hello, world!**');

This would then print:

<b>Hello, world!</b>

Using the Twig filter:

{{ 'Hello, world!' | markdown }}