Go to file
2010-11-08 13:53:22 +01:00
DependencyInjection Fix CS 2010-11-08 13:53:22 +01:00
Helper Rename Symfony\Components to Symfony\Component 2010-08-23 23:07:39 +02:00
Parser Improve doc and comments 2010-07-22 12:06:54 +02:00
Resources/config Introduce a Twig markdown filter 2010-09-19 21:05:36 +02:00
Tests Cleanup tests 2010-07-22 11:22:36 +02:00
Twig/Extension The markdown filter is automatically marked as safe 2010-10-03 09:59:27 +02:00
vendor/parser Improve doc and comments 2010-07-22 12:06:54 +02:00
.gitignore Initial commit 2010-05-05 17:11:02 +02:00
LICENSE Initial commit 2010-05-05 17:11:02 +02:00
MarkdownBundle.php updated to the last Symfony2 style 2010-09-19 09:03:06 +02:00
README.markdown Allow user to define his own parser classes 2010-11-08 20:48:50 +08:00

Provide markdown conversion to your Symfony2 projects.

INSTALLATION

Put MarkdownBundle in your src/Bundle dir.

Then enable it in your config.yml:

markdown.parser: ~      # Enable the parser service
markdown.helper: ~      # Enable the helper in the templates

Optionnally enable the twig markdown filter :

twig.config: ~          # Enable Twig
markdown.twig: ~        # Enable the markdown filter

You can also define your own Parser class :

markdown.parser:
    class: Bundle\HelloBundle\MarkdownParser

USAGE

// Use the service
$html = $this->container['markdownParser']->transform($text);

// Use the helper
echo $view['markdown']->transform($text);

If you have enabled the twig markdown filter, you can use the following in your twig templates:

{{ my_data | markdown }}

TEST

phpunit -c myapp src/Bundle/MarkdownBundle