写了个Laravel的Markdown解析器

在用laravel写网站的过程中,需要markdown解析器。于是就高速造了个轮子。

laravelmd - A Markdown Parser for Laravel

Based on PHP-Markdown

Installation

To get the latest version of laravelmd, simply require the project using Composer:

1
composer require imtms/laravelmd

Instead, you may of course manually update your require block and run composer update if you so choose:

1
2
3
4
5
{
"require": {
"imtms/laravelmd": "^1.0"
}
}

Configuration

Once laravelmd is installed, you need to register the service provider.

Open up config/app.php and add the following to the providers key.

1
imtms\laravelmd\laravelmdProvider::class,

You can register the Markdown facade in the aliases key of your config/app.php file if you like.

1
'laravelmd' => imtms\laravelmd\Facades\laravelmd::class,

Usage

1
\laravelmd::convert('foo'); // <p>foo</p>

License

The MIT License (MIT).

写了个Laravel的Markdown解析器

https://blog.tms.im/2016/06/28/laravel-markdown.html

作者

TMs

发布于

2016-06-28

更新于

2024-12-06

许可协议

评论