ueberdosis/commonmark-hint-extension
最新稳定版本:0.1.0
Composer 安装命令:
composer require ueberdosis/commonmark-hint-extension
包简介
A hint extension for league/commonmark
README 文档
README
We need your support to maintain this package. 💖 https://github.com/sponsors/ueberdosis
CommonMark Hint Extension
A hint extension for league/commonmark that renders the following Markdown as HTML.
Example
Markdown
:::important Warning! This is how the **Markdown** looks. :::
HTML
<div class="hint important"> <h2 class="hint-title"> Warning! </h2> <p class="hint-content"> This is how the <strong>Markdown</strong> looks. </p> </div>
Installation
You can install the package via composer:
composer require ueberdosis/commonmark-hint-extension
Usage
<?php use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\MarkdownConverter; use Ueberdosis\CommonMark\HintExtension; // Configure the Environment with all the CommonMark parsers/renderers $environment = new Environment(); $environment->addExtension(new CommonMarkCoreExtension()); // Add this extension $environment->addExtension(new HintExtension()); // Instantiate the converter engine and start converting some Markdown! $converter = new MarkdownConverter($environment); $markdown = <<<MARKDOWN :::important Warning! This is how the **Markdown** looks. ::: MARKDOWN; echo $converter->convertToHtml($markdown);
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 11.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-26