https://github.com/ccoley/laravel-markdown
A Parsedown wrapper for Laravel 5
https://github.com/ccoley/laravel-markdown
Last synced: 13 days ago
JSON representation
A Parsedown wrapper for Laravel 5
- Host: GitHub
- URL: https://github.com/ccoley/laravel-markdown
- Owner: ccoley
- Created: 2015-08-16T05:08:53.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-06-14T22:14:28.000Z (almost 8 years ago)
- Last Synced: 2023-08-04T10:21:09.246Z (almost 3 years ago)
- Language: PHP
- Homepage: https://packagist.org/packages/ccoley/laravel-markdown
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Markdown for Laravel 5
A [Parsedown][1] wrapper for Laravel to compile markdown to HTML.
Parsedown is fast and supports [GitHub flavored markdown][2].
The `Markdown` service provider included in this package uses deferred loading, meaning that it is not loaded with every request, and is instead loaded when you first use it.
## Installation
Require this package with composer using the following command:
```sh
composer require ccoley/laravel-markdown
```
After updating composer, add the service provider to the `providers` array in `config/app.php`
```php
Coley\Markdown\MarkdownServiceProvider::class,
```
If you want to use the `Markdown` facade, you need to add it to the `aliases` array in `config/app.php`
```php
'Markdown' => Coley\Markdown\MarkdownFacade::class
```
## Example
```php
// Regular parsing.
// Output:
Hello Markdown!
echo Markdown::text('Hello _Markdown_!');
// Parse only inline elements.
// Output: Hello Markdown!
echo Markdown::line('Hello _Markdown_!');
```
For more examples, or to see Parsedown configuration options, checkout the [Parsedown wiki][3].
[1]: http://parsedown.org/ "Official Parsedown Website"
[2]: https://help.github.com/articles/github-flavored-markdown/ "GFM Help"
[3]: https://github.com/erusev/parsedown/wiki "Parsedown Wiki"