inwebo/markdown-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require inwebo/markdown-bundle
包简介
README 文档
README
Introduction
The Inwebo Markdown Bundle integrates Inwebo\Markdown\Factory into Symfony applications, providing a simple and configurable way to convert Markdown to safe HTML. It registers the factory as a service for dependency injection, supports parser configuration and extensions, and is installed via Composer. Inject Inwebo\Markdown\Factory and call parse() to render Markdown content.
See Inwebo\Markdown for more information.
Installation
composer require inwebo/markdown-bundle
Usage
<?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Inwebo\Markdown\Factory; class MarkdownController extends AbstractController { // DI public function __construct(private readonly Factory $factory) { } #[Route('/markdown/preview', name: 'markdown_preview')] public function preview(): Response { $markdown = <<<'MD' # Bonjour Ceci est un exemple de *Markdown* converti en HTML via `Inwebo\Markdown\Factory`. MD; // Call the parser and you are done! $html = $this->factory->parse($markdown); return new Response($html, Response::HTTP_OK, ['Content-Type' => 'text/html; charset=utf-8']); } }
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-11-10