skepticalhippo / php-markdown-parser
Markdown compiler for Laravel 4
Requires
- laravel/framework: ~4
- skepticalhippo/php-markdown-lib: dev-master
Requires (Dev)
- mockery/mockery: 0.9.0
This package is not auto-updated.
Last update: 2025-01-04 17:47:47 UTC
README
Installation
Run composer require vtalbot/markdown:1.5
Run php artisan config:publish vtalbot/markdown
Then edit config.php
in app/config/packages/vtalbot/markdown
to your needs.
Add 'VTalbot\Markdown\MarkdownServiceProvider',
to providers
in app/config/app.php
and 'Markdown' => 'VTalbot\Markdown\Facades\Markdown',
to aliases
in app/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.
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');
Configuration
For more information on the Markdown configuration, you may refer to http://michelf.ca/projects/php-markdown/configuration .
Changelog
1.5
- Change deprecated dependency.
- Add Markdown file not found handler.
- Add configurations based on the new dependency.
- Add some tests.