weph/commonmark-section-extension
Composer 安装命令:
composer require weph/commonmark-section-extension
包简介
README 文档
README
This league/commonmark extension wraps headings and associated content into sections.
Installation & Basic Usage
composer require weph/commonmark-section-extension
Example:
use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\MarkdownConverter; use Weph\CommonMark\SectionExtension; $environment = new Environment(); $environment->addExtension(new CommonMarkCoreExtension()); $environment->addExtension(new SectionExtension()); $converter = new MarkdownConverter($environment); echo $converter->convert(<<<EOMD # Title ## Section 1 Section 1 content ### Section 1.1 Section 1.1 content ## Section 2 Section 2 content EOMD );
Output:
<section> <h1>Title</h1> <section> <h2>Section 1</h2> <p>Section 1 content</p> <section> <h3>Section 1.1</h3> <p>Section 1.1 content</p> </section> </section> <section> <h2>Section 2</h2> <p>Section 2 content</p> </section> </section>
统计信息
- 总下载量: 2.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-05