https://github.com/buzzylab/laradown
Markdown parser for Laravel built on parsedown
https://github.com/buzzylab/laradown
html laravel markdown parsedown php
Last synced: 12 months ago
JSON representation
Markdown parser for Laravel built on parsedown
- Host: GitHub
- URL: https://github.com/buzzylab/laradown
- Owner: buzzylab
- License: mit
- Created: 2016-06-25T02:54:20.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-17T09:52:10.000Z (almost 6 years ago)
- Last Synced: 2025-05-06T09:48:17.885Z (about 1 year ago)
- Topics: html, laravel, markdown, parsedown, php
- Language: CSS
- Homepage:
- Size: 39.1 KB
- Stars: 30
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Laradown
--------
[](https://packagist.org/packages/buzzylab/laradown)
[](https://packagist.org/packages/buzzylab/laradown)
[](//packagist.org/packages/buzzylab/laradown)
[](https://packagist.org/packages/buzzylab/laradown)
[](https://styleci.io/repos/61923982)
A New `Markdown` parser for Laravel built on [Parsedown](https://github.com/erusev/parsedown) and [Parsedown Extra](https://github.com/erusev/parsedown-extra).
## Installation
The best and easiest way to install this package is through [Composer](https://getcomposer.org/).
### Compatibility
This package fully compatible with **[Laravel](https://laravel.com)** above `5.4`.
### Require Package
Open your application's `composer.json` file and add the following line to the `require` array:
```json
"buzzylab/laradown": "~0.2"
```
> **Note:** Make sure that after the required changes your `composer.json` file is valid by running `composer validate`.
After installing the package, open your Laravel config file located at `config/app.php` and add the following service provider to the `$providers` array:
```php
Buzzylab\Laradown\MarkdownServiceProvider::class,
```
> **Note:** Checkout Laravel's [Service Providers](https://laravel.com/docs/5.8/providers) and [Service Container](https://laravel.com/docs/5.8/container) documentation for further details.
And add the following to `$aliases`
```php
'Markdown' => Buzzylab\Laradown\Facades\MarkdownFacade::class
```
## Usage
```php
{{-- $content is markdown data --}}
@markdown($content)
@stop
```
### Use `@markdown` with `@endmarkdown` as directive block:
```php
@extends('layouts.master')
@section('content')
@markdown
# Laradown Packag
@endmarkdown
@stop
```
### Add style to your converted html with `@markdownstyle`
```php
{{-- Get defaute style file --}}
@markdownstyle
{{-- Custom style file --}}
@markdownstyle($file)
```
## Helper Functions:
### `markdown($markdown)`
Convert markdown content to html
### `markdown_style()`
Add style to converted html
## License
This software is released under [The MIT License (MIT)](LICENSE).