2017 © Pedro PelĂĄez
 

library markdown

Markdown compiler for Laravel 4

image

vtalbot/markdown

Markdown compiler for Laravel 4

  • Friday, September 18, 2015
  • by vtalbot
  • Repository
  • 8 Watchers
  • 97 Stars
  • 32,814 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 27 Forks
  • 9 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

Markdown Compiler for Laravel

Installation

For Laravel 4

  1. Run composer require vtalbot/markdown:1.5
  2. Run php artisan config:publish vtalbot/markdown
  3. Then edit config.php in app/config/packages/vtalbot/markdown to your needs.
  4. Add 'VTalbot\Markdown\MarkdownServiceProvider', to providers in app/config/app.php and 'Markdown' => 'VTalbot\Markdown\Facades\Markdown', to aliases in app/config/app.php

For Laravel 5+

  1. Run composer require vtalbot/markdown:2.0
  2. Run php artisan vendor:publish --provider=“VTalbot\Markdown\MarkdownServiceProvider”
  3. Then edit markdown.php in your config directory to your needs.
  4. Add VTalbot\Markdown\MarkdownServiceProvider::class to providers in config/app.php and 'Markdown' => VTalbot\Markdown\Facades\Markdown::class to aliases in config/app.php

Usage

http://domain.name/test.md

If test.md doesn't exists in the public directory, it will search for test.md in app/markdown directory. If found, compile it if needed and return the result., (*1)

Markdown::make('file-in-markdown-directory');

Or, you can compile a simple string:, (*2)

Markdown::string('#test');

To handle markdown file not found:, (*3)

Markdown::setNotFoundHandler(function($file) { return 'Markdown file not found'; });
Markdown::setNotFoundHandler('MarkdownController@missing');

Configuration

Key Default value Description
paths array('/markdown') Directory where to find the markdown files.
routes array('',) Routes prefixes.
extensions array('markdown','md') Extensions used to set routes.
add_routes true Enable the creation of routes.
empty_element_suffix ' />' Suffix for empty element (br, hr).
tab_width 4 Tab character width.
no_markup false Prevent HTML tags to be passed to output.
no_entities false Convert entities like \&lt\; to \&amp\;.
predef_urls array() Add reference for urls. array('ref' => '//goo.gl'): [google][ref]
predef_titles array() Same as predef_urls.
use_extra true Use Markdown with extra, eg.: fenced code block.
fn_id_prefix '' Prefix for ID attributes generated by footnotes.
fn_link_title '' Title for footnotes links.
fn_backlink_title '' Same as fn_link_title.
fn_link_class 'footnote-ref' CSS class for footnotes links and backlinks.
fn_backlink_class 'footnote-backref' Same as fn_link_class.
code_class_prefix '' Prepend CSS class to fenced code block.
code_attr_on_pre false Put attributes on pre instead of code.
predef_abbr array() Create predefine abbreviations.

For more information on the Markdown configuration, you may refer to http://michelf.ca/projects/php-markdown/configuration ., (*4)

Changelog

2.0

  • Add support for Laravel 5

1.5

  • Change deprecated dependency.
  • Add Markdown file not found handler.
  • Add configurations based on the new dependency.
  • Add some tests.

The Versions

18/09 2015

dev-master

9999999-dev

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

18/09 2015

2.0.1

2.0.1.0

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

12/09 2015

2.0

2.0.0.0

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

26/08 2015

dev-laravel-4

dev-laravel-4

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

26/08 2015

1.5.1

1.5.1.0

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

29/04 2014

1.5

1.5.0.0

Markdown compiler for Laravel 4

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

14/12 2013

1.4.2

1.4.2.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

laravel markdown illuminate md

21/07 2013

1.4.1

1.4.1.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

laravel markdown illuminate md

10/07 2013

1.4

1.4.0.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

laravel markdown illuminate md

22/04 2013

1.3

1.3.0.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

08/02 2013

1.2

1.2.0.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md

22/01 2013

1.1

1.1.0.0

Markdown compiler for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel markdown illuminate md