cable8mm/commonmark-unfenced 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cable8mm/commonmark-unfenced

Composer 安装命令:

composer require cable8mm/commonmark-unfenced

包简介

README 文档

README

Unleash your fenced code.

An extension for league/commonmark.

Installation

After installing the package, you will need to register the extension.

Using graham-campbell/markdown

In your config/markdown.php file, add the extension somewhere after the CommonMarkCoreExtension:

  return [
      // ...
      'extensions' => [
          League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension::class,
          League\CommonMark\Extension\GithubFlavoredMarkdownExtension::class,
+         Laravel\Unfenced\UnfencedExtension::class,
      ],
  ];

Manually

use Laravel\Unfenced\UnfencedExtension;
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\MarkdownConverter;

$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new UnfencedExtension());

$converter = new MarkdownConverter($environment);
echo $converter->convert('...');

Usage

Features are enabled via the "info" string of the code fence.

Note

This extension does not include any CSS.

Adding file names

To display a file name above your code, add the filename attribute:

```php filename=src/Hello.php
// ...
```

image

Adding tabs

Adjacent code fences can be grouped into a tabbed view by specifying the tab attribute:

```vue tab=Vue
// ...
```

```javascript tab=React
// ...
```

image

You may also include the filename attribute, which is especially helpful when providing code samples where the file name differs depending on the language:

```vue tab=Vue filename=Welcome.vue
// ...
```

```javascript tab=React filename=Welcome.jsx
// ...
```

image

The extension will inject JavaScript into your page when tabs are used. The JavaScript enables the following features:

  • It will apply an active class to the active tab button and tab content. You may use CSS to highlight the active tab, and hide the inactive tab content.
  • If multiple tabbed sections are found, and they contain identical tab names, they will be synchronized. I.e, clicking the "React" tab in one section, will switch to that tab in all sections.
  • The active tab is saved to the browsers local storage so that it persists between pages and visits.

cable8mm/commonmark-unfenced 适用场景与选型建议

cable8mm/commonmark-unfenced 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.01k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 cable8mm/commonmark-unfenced 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-06