Go to file
2011-03-12 18:47:26 +01:00
DependencyInjection Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
Helper Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
Parser Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
Resources/config Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
Tests Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
Twig/Extension Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01: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
KnplabsMarkdownBundle.php Change namespaces to Vendor\Bundle\BundleName to reflect best practices. 2011-03-12 18:47:26 +01:00
LICENSE Initial commit 2010-05-05 17:11:02 +02:00
README.markdown Update doc 2011-02-26 00:21:13 +08:00

Provide markdown conversion to your Symfony2 projects.

INSTALLATION

Put MarkdownBundle in your src/Bundle dir.

Then enable it in your config.yml: knplabs_markdown: parser: ~ # Enable the parser service helper: ~ # Enable the helper in the templates

Optionnally enable the twig markdown filter :

twig: ~          # Enable Twig
knplabs_markdown:
  twig: ~        # Enable the markdown filter

You can also define your own Parser class :

knplabs_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