写了个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 | { |
¶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
写了个Laravel的Markdown解析器