vtalbot/markdown is a Laravel package for markdown compiler for laravel 5.
It currently has 98 GitHub stars and 239.484 downloads on Packagist (latest version 3.0.0).
Install it with composer require vtalbot/markdown.
Discover more Laravel packages by vtalbot
or browse all Laravel packages to compare alternatives.
Last updated
composer require vtalbot/markdown:1.5php artisan config:publish vtalbot/markdownconfig.php in app/config/packages/vtalbot/markdown to your needs.'VTalbot\Markdown\MarkdownServiceProvider', to providers in app/config/app.php and
'Markdown' => 'VTalbot\Markdown\Facades\Markdown', to aliases in app/config/app.phpcomposer require vtalbot/markdown:2.0php artisan vendor:publish --provider=“VTalbot\Markdown\MarkdownServiceProvider”markdown.php in your config directory to your needs.VTalbot\Markdown\MarkdownServiceProvider::class to providers in config/app.php and
'Markdown' => VTalbot\Markdown\Facades\Markdown::class to aliases in config/app.phphttp://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.
Markdown::make('file-in-markdown-directory');
Or, you can compile a simple string:
Markdown::string('#test');
To handle markdown file not found:
Markdown::setNotFoundHandler(function($file) { return 'Markdown file not found'; });
Markdown::setNotFoundHandler('MarkdownController@missing');
| 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 < to &. |
| 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 .