KalmanOlah/MarkdownBundle
Markdown/Parsedown bundle for Symfony2 providing a service and a twig filter, (*1)
Installation
Just add this to your composer.json
:, (*2)
...
"require": {
...
"kalmanolah/markdownbundle": "*@dev",
...
}
...
Afterwards, enable the bundle in your AppKernel.php
like so:, (*3)
$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:, (*4)
<b>Hello, world!</b>
Using the Twig filter:
{{ 'Hello, world!' | markdown }}