2017 © Pedro Peláez
 

library silex-markdown-provider

Silex Service Provider using cebe/markdown

image

nachonerd/silex-markdown-provider

Silex Service Provider using cebe/markdown

  • Saturday, September 12, 2015
  • by irgalieri
  • Repository
  • 1 Watchers
  • 0 Stars
  • 75 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Silex Markdown Provider

Latest Stable Version Total Downloads Latest Unstable Version License Build Status Code Climate Test Coverage Minimum PHP Version, (*1)

SensioLabsInsight, (*2)

Description

Silex Service Provider using cebe/markdown. cebe/markdown was created by Carsten Brandt., (*3)

License

GPL-3.0, (*4)

Requirements

Install

composer require nachonerd/silex-markdown-provider

Usage

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

...
$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']., (*6)

Twig Extension

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

  • markdown_parse_last_file Parse last file in markdown,path directory to html

{{ markdown_parse_last_file() }}

Example

<?php
    require_once __DIR__.'/../vendor/autoload.php';

    $app = new Silex\Application();

    // Considering the config.yml files is in the same directory as index.php
    $app->register(
        new \NachoNerd\Silex\Finder\Provider(),
        array(
            "nn.markdown.path" => __DIR__,
            "nn.markdown.flavor" => original,
            "nn.markdown.filter" => '/\.md/'
        )
    );
    $app->boot();

    ...
    // traditional markdown and parse full text
    $parser = $app[nn.markdown];
    $hmtl = $parser->parse($markdown);
    $hmtl = $parser->parseFile($filename);
    $finder = $parser->getAllFiles($filename);
    $finder = $parser->getNLastFiles(10);
    ...

The Versions

12/09 2015

dev-master

9999999-dev

Silex Service Provider using cebe/markdown

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

service php silex markdown provider serviceprovider

12/09 2015

1.0.4

1.0.4.0

Silex Service Provider using cebe/markdown

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

service php silex markdown provider serviceprovider

11/09 2015

1.0.3

1.0.3.0

Silex Service Provider using cebe/markdown

  Sources   Download

GNU GPL V3

The Requires

 

The Development Requires

service php silex markdown provider serviceprovider