andchir / markdown-bundle
Symfony 3.x 的 Markdown 扩展包
1.0.4
2020-06-04 11:44 UTC
Requires
- erusev/parsedown: ^1.7
README
composer require andchir/markdown-bundle
使用示例
{{ currentPage.description | markdown }}
{{ currentPage.description | markdown({urlsLinked: false, safeMode: true, breaksEnabled: true, markupEscaped: true}) }}
{{ includeFileContent(currentPage.file_content_path) | markdown }}
将文件内容保存到文档字段
{% 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]
];
更新文件内容的命令
php bin/console markdown:action update_content documentation file_content_path description
composer require erusev/parsedown