承接 parsedown/laravel 相关项目开发

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

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

parsedown/laravel

最新稳定版本:1.2.1

Composer 安装命令:

composer require parsedown/laravel

包简介

Official Parsedown's Laravel Wrapper.

README 文档

README

You might also like Caret - our Markdown editor for Mac / Windows / Linux.

Parsedown for Laravel

Build Status

This package is a Laravel wrapper around Parsedown. If you want to know more about Parsedown alone check out our base repository.

Features

  • Blade Directive
  • Configuration File
  • Helper Function

Installation

Parsedown for Laravel is available as a Composer package. You can install it using the command below:

composer require parsedown/laravel

Configuration

If you're using Laravel +5.5 you don't need to follow the steps below. The package auto-discovery feature has been implemented and will take care of loading the service provider for you.

But if that's not your case you will need to add the service provider to your config/app.php file:

return [
    // Other configurations above...

    'providers' => [
        // Other providers above...
        Parsedown\Providers\ParsedownServiceProvider::class,
        // Other providers below...
    ],

    // Other configurations below...
];

This package uses the Parsedown\Providers\ParsedownServiceProvider service provider to create a singleton of Parsedown. That's stored it in a container called parsedown. It uses the following options to set the default behavior for that instance:

Name Description Default
breaks_enabled Converts line breaks such as \n into <br /> tags. false
inline Enables inline parsing for the parsedown() helper and the @parsedown directive by default. false
markup_escaped Escapes HTML in trusted input. Redundant if safe_mode is enabled. false
safe_mode Doesn't process untrusted user-input. true
urls_linked Automatically converts URLs into anchor tags. true

You can overwrite these values by publishing the config/parsedown.php file with the following command:

php artisan vendor:publish --provider="Parsedown\Providers\ParsedownServiceProvider"

Usage

The snippets below show how you can easily use Parsedown in your *.blade.php files:

@parsedown('Hello _Parsedown_!')

...or (using the helper approach)

{{ parsedown('Hello _Parsedown_!') }}

Any of the code above will generate:

<p>Hello <em>Parsedown</em>!</p>

If you want to parse a value using the inline style you just need to set the second argument as true:

@parsedown('Hello _Parsedown_!', true)

...or (using the helper approach)

{{ parsedown('Hello _Parsedown_!', true) }}

Any of the code above will generate:

Hello <em>Parsedown</em>!

The helper is globally available and can also be used with PHP code throughout your project.

Lumen Support

Laravel and Lumen pretty much share the same core code. The instructions below should be enough to set this package for your Lumen project.

Enable Facades in Your Project

Ensure you have the following in your bootstrap/app.php file:

$app->withFacades();

Service Provider Registering

As Lumen does not support package auto-discovery you got to do it manually adding the code below in your bootstrap/app.php file:

$app->register(Parsedown\Providers\ParsedownServiceProvider::class);

parsedown/laravel 适用场景与选型建议

parsedown/laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.04M 次下载、GitHub Stars 达 83, 最近一次更新时间为 2017 年 05 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 1.04M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 86
  • 点击次数: 5
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

  • Stars: 83
  • Watchers: 4
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-08