Skip to content
Snippets Groups Projects
Select Git revision
  • d46d95c1fa5f549ae00dc6ef32bc33801331cecf
  • master default
  • v1.0.0
3 results

laravel-markdown

  • Clone with SSH
  • Clone with HTTPS
  • Chris Coley's avatar
    Chris Coley authored
    d46d95c1
    History
    Name Last commit Last update
    src
    README.md
    composer.json

    Markdown for Laravel 5

    A Parsedown wrapper for Laravel to compile markdown to HTML.

    Parsedown is fast and supports GitHub flavored markdown.

    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:

    composer require ccoley/laravel-markdown

    After updating composer, add the service provider to the providers array in config/app.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

    'Markdown' => Coley\Markdown\MarkdownFacade::class

    Example

    // Regular parsing.
    // Output: <p>Hello <em>Markdown</em>!</p>
    echo Markdown::text('Hello _Markdown_!');
    
    // Parse only inline elements.
    // Output: Hello <em>Markdown</em>!
    echo Markdown::line('Hello _Markdown_!');

    For more examples, or to see Parsedown configuration options, checkout the Parsedown wiki.