Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Markdown for Laravel

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 controllers
Octocat-spinner-32 LICENSE
Octocat-spinner-32 apigen.neon
Octocat-spinner-32 bundle.php
Octocat-spinner-32 parser.php
Octocat-spinner-32 readme.md
Octocat-spinner-32 start.php
Octocat-spinner-32 view.php
readme.md

Sparkdown Bundle

A simple bundle to provide Markdown and Markdown Extra functions.

Links and image URLs are passed through Laravel\URL::to and Larave\URL::to_asset.

Installation

Install via the Artisan CLI:

php artisan bundle:install sparkdown

Or download the zip and unpack into your bundles directory.

Bundle Registration

Just add 'sparkdown' to your application/bundles.php file.

Guide

Parse some text

Start the bundle and use Sparkdown\Markdown

Bundle::start('sparkdown');
echo Sparkdown\Markdown($text);

View a markdown file

You can create Sparkdown\View objects, like Laravel\View objects

Router::register('GET /about', function()
{
    // View of application/views/about.md
    return Sparkdown\View::make('about');

    // Also supports bundles and paths...
    // View of bundles/bundle/views/path/file.md
    return Sparkdown\View::make('bundle::path.file');
});

And you can route to the handy controller (needs 1 parameter).

Route::get('(about)', 'sparkdown::page@show');
Something went wrong with that request. Please try again.