PHPackages                             nachonerd/silex-markdown-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. nachonerd/silex-markdown-provider

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

nachonerd/silex-markdown-provider
=================================

Silex Service Provider using cebe/markdown

1.0.4(10y ago)087GPL-3.0PHPPHP &gt;=5.4.0

Since Sep 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nachonerd/silex-markdown-provider)[ Packagist](https://packagist.org/packages/nachonerd/silex-markdown-provider)[ RSS](/packages/nachonerd-silex-markdown-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (3)Used By (0)

Silex Markdown Provider
=======================

[](#silex-markdown-provider)

[![Latest Stable Version](https://camo.githubusercontent.com/705da0e1e420229e8757294f0d6e144f47c0871207d398c52da8aa7afecd705f/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f762f737461626c65)](https://packagist.org/packages/nachonerd/silex-markdown-provider)[![Total Downloads](https://camo.githubusercontent.com/37c513ff76c6ca68ee1a7376766f28d6fcfb1619b5cf233dfd51e276419767e6/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/nachonerd/silex-markdown-provider)[![Latest Unstable Version](https://camo.githubusercontent.com/eee0e4ee2f7ed7b6521f6f62b2f6b48804b29ba444d3b7518181bd81f9cf000f/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f762f756e737461626c65)](https://packagist.org/packages/nachonerd/silex-markdown-provider) [![License](https://camo.githubusercontent.com/50df0adb002fdd2fffd872da49822eeac681fd594852e9364fa8abd18810f82d/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f6c6963656e7365)](https://packagist.org/packages/nachonerd/silex-markdown-provider)[![Build Status](https://camo.githubusercontent.com/72a72cf3bbbb609c048af879ac027d97d595803a28d8d9cd0254fc2add3c59d1/68747470733a2f2f7472617669732d63692e6f72672f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nachonerd/silex-markdown-provider)[![Code Climate](https://camo.githubusercontent.com/d422e3f40a6768923302b949c8353763f8c193503ab970b6e4a94758f41f7bf3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f6261646765732f6770612e737667)](https://codeclimate.com/github/nachonerd/silex-markdown-provider)[![Test Coverage](https://camo.githubusercontent.com/ad44f9fb78fdf9cacd4a4e994ed0cc88fd9c0fb9471eb1927b462cf0a54014e2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6163686f6e6572642f73696c65782d6d61726b646f776e2d70726f76696465722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/nachonerd/silex-markdown-provider/coverage)[![Minimum PHP Version](https://camo.githubusercontent.com/b52c83f3d45755ebcb1e6863ebb202ab192aaf773424369ffdeedae107f027ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)

[![SensioLabsInsight](https://camo.githubusercontent.com/88b77a64185e2860783d451f389b65a364f5f3d0089daaf023a4263fdcbbeed1/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38633866343563662d373962612d343839382d393563302d3537356134323265346163642f6269672e706e67)](https://insight.sensiolabs.com/projects/8c8f45cf-79ba-4898-95c0-575a422e4acd)

### Description

[](#description)

Silex Service Provider using [cebe/markdown](http://markdown.cebe.cc/). cebe/markdown was created by [Carsten Brandt](http://cebe.cc/about).

### License

[](#license)

GPL-3.0

### Requirements

[](#requirements)

- [PHP version 5.4](http://php.net/releases/5_4_0.php)
- [Composer](https://getcomposer.org/)
- [SILEX](http://silex.sensiolabs.org/)
- [Synfony Finder](http://symfony.com/doc/current/components/finder.html)
- [cebe/markdown](http://markdown.cebe.cc/)
- [PHP Unit 4.7.x](https://phpunit.de/) (optional)
- [PHP\_CodeSniffer 2.x](http://pear.php.net/package/PHP_CodeSniffer/redirected) (optional)

### Install

[](#install)

```
composer require nachonerd/silex-markdown-provider

```

### Usage

[](#usage)

Include following line of code somewhere in your initial Silex file (index.php or whatever):

```
...
$app->register(
    new \NachoNerd\Silex\Markdown\Provider(),
    array(
        "nn.markdown.path" => __DIR__,
        "nn.markdown.flavor" => 'extra',
        "nn.markdown.filter" => '/\.md/'
    )
);
...
```

Now you have access to instance of cebe/markdown throw $app\['nn.markdown'\].

### Twig Extension

[](#twig-extension)

#### Filters

[](#filters)

- **markdown\_parse**Parse specified text to html

```
{{ "## Some text"|markdown_parse }}

.....

{{ texttoparse|markdown_parse }}
```

- **markdown\_parse\_file**Parse specified file to html

```
{{ "some/file.md"|markdown_parse_file }}

.....

{{ filename|markdown_parse_file }}
```

#### Functions

[](#functions)

- **markdown\_parse\_last\_file**Parse last file in markdown,path directory to html

```
{{ markdown_parse_last_file() }}
```

### Example

[](#example)

```
