定制 moxio/commonmark-ext-definition-list 二次开发

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

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

moxio/commonmark-ext-definition-list

Composer 安装命令:

composer require moxio/commonmark-ext-definition-list

包简介

Extension for league/commonmark to support definition lists

README 文档

README

Continuous Integration Latest Stable Version Buy us a tree

moxio/commonmark-ext-definition-list

Extension for the league/commonmark Markdown parser to support definition lists.

Uses unofficial markdown syntax based on the syntax supported by PHP Markdown Extra, Pandoc and markdown-it. See the section Syntax below for details.

Requirements

This library requires PHP version 7.4 or higher and a 1.x release of league/commonmark.

Installation

Install as a dependency using composer:

$ composer require --dev moxio/commonmark-ext-definition-list

Usage

Add DefinitionListExtension as an extension to your CommonMark environment instance and you're good to go:

use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use Moxio\CommonMark\Extension\DefinitionList\DefinitionListExtension;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new DefinitionListExtension());

// Use $environment when building your CommonMarkConverter
$converter = new CommonMarkConverter([], $environment);
echo $converter->convertToHtml('
Term 1
: Definition of term 1.

Term 2
: Definition of term 2.
');

See the CommonMark documentation for more information about using extensions.

Syntax

The supported markdown syntax is based on the one used by PHP Markdown Extra, Pandoc and markdown-it. Since there are subtle differences between the syntaxes understood by these libraries and there is no formally defined standard, 100% compatibility with any of the aforementioned libraries cannot be guaranteed. The use of the tilde (~) as a definition list marker (as understood by Pandoc) is also supported.

A simple example:

Apple
:   Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

The will yield HTML output like:

<dl>
  <dt>Apple</dt>
  <dd>Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.</dd>
  <dt>Orange</dt>
  <dd>The fruit of an evergreen tree of the genus Citrus.</dd>
</dl>

A more complex example:

Term 1

:   This is a definition with two paragraphs. Lorem ipsum
    dolor sit amet, consectetuer adipiscing elit. Aliquam
    hendrerit mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus.

:   Second definition for term 1, also wrapped in a paragraph
    because of the blank line preceding it.

Term 2

:   This definition has a code block, a blockquote and a list.

        code block.

    > block quote
    > on two lines.

    1.  first list item
    2.  second list item

Versioning

This project adheres to Semantic Versioning.

Contributing

Contributions to this project are more than welcome. When reporting an issue, please include the input to reproduce the issue, along with the expected output. When submitting a PR, please include tests with your changes.

License

This project is released under the MIT license.

Treeware

This package is Treeware. If you use it in production, then we'd appreciate it if you buy the world a tree to thank us for our work. By contributing to the Treeware forest you'll be creating employment for local families and restoring wildlife habitats.

Made with love, coffee and fun by the Moxio team from Delft, The Netherlands. Interested in joining our awesome team? Check out our vacancies (in Dutch).

moxio/commonmark-ext-definition-list 适用场景与选型建议

moxio/commonmark-ext-definition-list 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.28k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「markdown」 「extension」 「commonmark」 「definition-list」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 moxio/commonmark-ext-definition-list 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 moxio/commonmark-ext-definition-list 我们能提供哪些服务?
定制开发 / 二次开发

基于 moxio/commonmark-ext-definition-list 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 10
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-18