2017 © Pedro Peláez
 

library silex-markdown

Markdown extension for Silex

image

mheap/silex-markdown

Markdown extension for Silex

  • Tuesday, October 10, 2017
  • by mheap
  • Repository
  • 2 Watchers
  • 7 Stars
  • 2,829 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Silex-Markdown

Build Status, (*1)

Requirements

This extension only works with PHP 7.1+ and Silex 2. Version 1.0.0 is compatible with Silex 1., (*2)

Installation

Install with composer:, (*3)

composer require mheap/silex-markdown

Usage

First, you need to register the Markdown extension. This will use the default settings for the extension., (*4)

$app->register(new \SilexMarkdown\MarkdownExtension());

If you'd like to disable certain transformations, you can provide them when registering the extension. This will not convert headers from markdown to HTML., (*5)

$app->register(new MarkdownExtension(), array(
    'markdown.features'   => array(
        'header' => false,
    )
));

To render markdown, use $app['markdown']:, (*6)

$app->get('/', function() use($app) {
    $html = $app['markdown']->transform('# Hello World'); // <h1>Hello World</h1>
});

If you're using Twig via Silex\Provider\TwigServiceProvider(), a markdown filter will be automatically registered for you. This allows you do do the following:, (*7)

// In your route
$app->get('/', function() use($app) {
    $text = '# Hello World';
    $html = $app['twig']->render('example.twig', array(
        'input' => $text
    ));
});
// In your twig file
{{ input | markdown }}

Running the tests

There are no external dependencies for this library. Just composer install then run ./vendor/bin/phpunit, (*8)

The Versions

10/10 2017
01/11 2016

2.0.1

2.0.1.0 https://github.com/mheap/Silex-Markdown

Markdown extension for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

silex markdown

01/11 2016

2.0.0

2.0.0.0 https://github.com/mheap/Silex-Markdown

Markdown extension for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

silex markdown

22/12 2013

dev-develop

dev-develop https://github.com/mheap/Silex-Markdown

Markdown extension for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

silex markdown

21/08 2012

dev-rename

dev-rename https://github.com/mheap/Silex-Markdown

Markdown extension for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

silex markdown