andchir/markdown-bundle

Symfony 3.x 的 Markdown 扩展包

安装: 37

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.4 2020-06-04 11:44 UTC

This package is auto-updated.

Last update: 2024-09-05 19:04:32 UTC


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