Created
November 21, 2013 13:47
-
-
Save dkesberg/7581812 to your computer and use it in GitHub Desktop.
Ciconia Markdown Parser ServiceProvider & Facade for Laravel 4 Ciconia offers Github Flavored Markdown as extension and i really like to have "proper" linebreaks ;) Ciconia: https://github.com/kzykhys/Ciconia
Laravel: https://github.com/laravel/laravel
Github Flavored Markdown: https://help.github.com/articles/github-flavored-markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace dkesberg\Facades; | |
use Illuminate\Support\Facades\Facade; | |
class CiconiaFacade extends Facade { | |
protected static function getFacadeAccessor() | |
{ | |
return 'markdown'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* only uses the gfm whitespace extension for linebreaks, check out the ciconia repository for more options | |
*/ | |
namespace dkesberg\ServiceProvider; | |
use Ciconia\Ciconia; | |
use Ciconia\Extension\Gfm; | |
use Illuminate\Support\ServiceProvider; | |
class MarkdownServiceProvider extends ServiceProvider { | |
public function register() | |
{ | |
$this->app->bind('markdown', function() | |
{ | |
$ciconia = new Ciconia(); | |
$ciconia->addExtension(new Gfm\WhiteSpaceExtension()); | |
return $ciconia; | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.master') | |
@section('content') | |
<div> | |
{{ Markdown::render($content) }} | |
</div> | |
@stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you give me a bit information how to install?