承接 clippings/parsedown-provider 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

clippings/parsedown-provider

Composer 安装命令:

composer require clippings/parsedown-provider

包简介

Pimple service provider for Parsedown.

README 文档

README

This is a service provider for the Markdown parser Parsedown. It could be used to easily use and configure Parsedown with Pimple or Silex.

Build Status

Installation

Install the latest version with Composer:

composer require clippings/parsedown-provider

Usage

Register the service provider in the Pimple container and enjoy!

$app->register(new Clippings\ParsedownProvider\ParsedownServiceProvider());

$html = $app['parsedown']->text($markdown);

It registers one service - parsedown which returns the same instance of Parsedown.

Configuration

You can configure it like that:

$app->register(new Clippings\ParsedownProvider\ParsedownServiceProvider(), [
    'parsedown.markup_escaped' => true,
]);

It accepts the following configuration parameters:

  • parsedown.class - The class to use to instantiate Parsedown. Default: Parsedown. You can use that to load an an extension of Parsedown like ParsedownExtra.

    Don't forget to composer require erusev/parsedown-extra and then you can do:

    $app->register(new Clippings\ParsedownProvider\ParsedownServiceProvider(), [
        'parsedown.class' => 'ParsedownExtra',
    ]);
  • parsedown.breaks_enabled - Whether to treat line breaks as new lines or not. Default: true. This is not the default for Markdown and Parsedown, but it is very common configuration - e.g. GitHub treats line breaks like that.

  • parsedown.markup_escaped - Whether to escape HTML. Default: false.

  • parsedown.urls_linked - Whether URLs are linked by default. Default: true. This is the Parsedown default. URLs would be auto-linked. It is similar to GFM.

Twig

If you have already registered Twig, probably with the TwigServiceProvider, the Parsedown service provider would also register a parsedown Twig filter for you to use in your templates.

You can use it like that:

{{ foo.markdown|parsedown }}

This will convert the Markdown you have directly in your template and output HTML using the same Parsedown instance you have configured.

Silex Application Trait

If you use it with Silex you can add the ParsedownTrait in your application:

<?php

class Application extends Silex\Application
{
    use Clippings\ParsedownProvider\ParsedownTrait;
}

Then you could use it like that:

$html = $app->parsedown($markdown);

Authors and License

The Parsedown provider was developed by the Clippings.com team and is distributed under the MIT license.

Read more about our projects at the Clippings Geeks blog.

clippings/parsedown-provider 适用场景与选型建议

clippings/parsedown-provider 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 87.75k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 clippings/parsedown-provider 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 24
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-01