ronanguilloux / silexmarkdownserviceprovider
Silex micro-framework Markdown service provider
Installs: 146
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:lib
Requires
- php: >=5.3.3
- michelf/php-markdown: 1.3.*@dev
Requires (Dev)
- silex/silex: *
- twig/twig: >=1.2.0
This package is auto-updated.
Last update: 2024-10-22 20:27:32 UTC
README
Silex PHP micro-framework Markdown Service Provider
To be used with Michel Fortin's michelf/php-markdown PHP parser for Markdown and Markdown Extra derived from the original Markdown.pl by John Gruber
Implementations examples:
- SilexMarkdown demo website (github repository)
Usage
<?php # app.php use Rg\Silex\Provider\Markdown\MarkdownServiceProvider; $app->register(new MarkdownServiceProvider(), array( 'md.path' => __DIR__ .'/relative-path-to-markdown-files-directory') ); // Retrieve .md file content $markdown = $app['md.finder']->getContent('path-to-mardown-file'); // Parse it into html $html = $app['md.parser']->transform($markdown);
Tests
Tests need --dev option while installing dependecing using composer:
$ composer.phar install --dev
$ wget http://pear.phpunit.de/get/phpunit.phar
$ chmod +x phpunit.phar
$ ./phpunit.phar
License
This Silex Service Provider is released under the MIT License.
See the bundled LICENSE file for details.
You can find a copy of this software here: https://github.com/ronanguilloux/SilexMarkdownServiceProvider