定制 jsw/commonmark-figure-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jsw/commonmark-figure-extension

Composer 安装命令:

composer require jsw/commonmark-figure-extension

包简介

League/commonmark extension for HTML figure and caption.

README 文档

README

League\CommonMark extension for HTML diagrams and captions inspired by Markdig.

Installation

$ composer require jsw/commonmark-figure-extension

Usage

  • Fence the top and bottom of the sentence you want to be a figure with ^ like a code block
  • Continued text in bottom fence becomes figure caption
  • Even if the number of upper and lower ^ is different, it will be processed normally
$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
            ->addExtension(new FigureExtension());

$converter = new MarkdownConverter($environment);

$markdown =<<<EOL
^^^
![example-image](https://example.com/image.jpg)
^^^ 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);

Contribution

  1. Fork it (https://github.com/JanStanleyWatt/commonmark-figure-extension)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Rebase your local changes against the master branch (if necessary)
  5. Run test suite with the composer test command and confirm that it passe
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

License

Apache-v2

统计信息

  • 总下载量: 2.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固