jsw / commonmark-figure-extension
League/commonmark 扩展,用于HTML图示和标题。
1.2.0
2024-01-10 12:07 UTC
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.14
- league/commonmark: ^2.3
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-10 14:53:54 UTC
README
League/CommonMark 扩展,用于HTML图示和标题,灵感来源于 Markdig。
安装
$ composer require jsw/commonmark-figure-extension
使用
- 使用
^
将你想要成为图示的句子的顶部和底部括起来,就像代码块一样 - 底部括号内的连续文本将成为图示标题
- 即使上下
^
的数量不同,也会正常处理
$environment = new Environment(); $environment->addExtension(new CommonMarkCoreExtension()); ->addExtension(new FigureExtension()); $converter = new MarkdownConverter($environment); $markdown =<<<EOL ^^^  ^^^ This is caption for image EOL; // <figure><p><img src="https://example.com/image.jpg" alt="example-image" /></p> // <figcaption>This is caption for image</figcaption></figure> echo $converter->convert($markdown);
贡献
- 分支它 (https://github.com/JanStanleyWatt/commonmark-figure-extension)
- 创建你的功能分支 (
git checkout -b my-new-feature
) - 提交你的更改 (
git commit -am 'Add some feature'
) - 将你的本地更改与主分支合并(如果需要的话)
- 使用
composer test
命令运行测试套件并确认通过 - 将更改推送到分支 (
git push origin my-new-feature
) - 创建新的Pull Request
许可证
Apache-v2