Markdown parser for Laravel built on parsedown
CSS PHP
Latest commit 6e16d04 Dec 31, 2016 @maherelgamil maherelgamil Fixed issue#6
Permalink
Failed to load latest commit information.
public Added markdown style functions Aug 18, 2016
src Fixed issue#6 Dec 31, 2016
.gitignore Added composer.lock to gitignore Aug 18, 2016
CHANGELOG.md Added more to changes log Aug 18, 2016
LICENSE initialization.. Jun 25, 2016
README.md documentation enhancement Aug 20, 2016
composer.json Fixed issue#6 Dec 31, 2016

README.md

Laradown

Latest Stable Version Total Downloads Latest Unstable Version License StyleCI

A New Markdown parser for Laravel built on Parsedown and Parsedown Extra.

Installation

The best and easiest way to install this package is through Composer.

Compatibility

This package fully compatible with Laravel 5.1.*|5.2.*|5.3.*.

Require Package

Open your application's composer.json file and add the following line to the require array:

"buzzylab/laradown": "0.1.*"

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:

Buzzylab\Laradown\MarkdownServiceProvider::class,

Note: Checkout Laravel's Service Providers and Service Container documentation for further details.

And add the following to $aliases

'Markdown' => Buzzylab\Laradown\Facades\MarkdownFacade::class

Usage

<?php

echo Markdown::render(); // OR echo Markdown::convert();

That's all.

Blade Directive:

Use @markdown directive with parameter:

@extends('layouts.master')

@section('content')
<div>

  {{-- $content is markdown data --}}
  @markdown($content)
</div>
@stop

Use @markdown with @endmarkdown as directive block:

@extends('layouts.master')

@section('content')
<div>
  @markdown

  # Laradown Packag

  @endmarkdown
</div>
@stop

Add style to your converted html with @markdownstyle

    {{-- 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).