andchir/markdown-bundle

Markdown bundle for Symfony 3.x

1.0.4 2020-06-04 11:44 UTC

This package is auto-updated.

Last update: 2024-04-05 18:13:50 UTC


README

composer require andchir/markdown-bundle

Usage example:

{{ currentPage.description | markdown }}
{{ currentPage.description | markdown({urlsLinked: false, safeMode: true, breaksEnabled: true, markupEscaped: true}) }}
{{ includeFileContent(currentPage.file_content_path) | markdown }}

Save content from file to the document field:

{% if currentPage.description is defined and currentPage.description is not empty %}
    {{ currentPage.description | markdown }}
{% else %}
    {{ includeFileContent(currentPage.file_content_path, 'documentation', currentPage.id, 'description') | markdown }}
{% endif %}

bundles.php:

return [
    ...,
    Andchir\MarkdownBundle\MarkdownBundle\MarkdownBundle::class => ['all' => true]
];

Command to update content from file:

php bin/console markdown:action update_content documentation file_content_path description
composer require erusev/parsedown