2017 © Pedro Peláez
 

library silex-markdown

Simple Silex wrapper for the Dragonfly markdown library

image

nicl/silex-markdown

Simple Silex wrapper for the Dragonfly markdown library

  • Monday, August 5, 2013
  • by nicl
  • Repository
  • 2 Watchers
  • 10 Stars
  • 10,963 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 2 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

Silex-Markdown

A lightweight markdown service provider for Silex. Uses the Dragonfly markdown parser., (*1)

Installation

Recommended installation is through composer. Just add the following to your composer.json file:, (*2)

{
    "minimum-stability": "dev",
    "require": {
        "nicl/silex-markdown": "1.0.*"
    }
}

Usage

To use the service provider first register it:, (*3)

$app->register(new MarkdownServiceProvider());

You can then use the markdown filter in Twig files. For example:, (*4)

{{ '#Hello World'|markdown }}

In addition, you also have access to the Markdown parser itself. Simply instantiate it and call the transformMarkdown method as follows:, (*5)

use dflydev\markdown\MarkdownParser;

$parser = new MarkdownParser();
$parser->transformMarkdown($txt);

Configuration

Parameters

  • markdown.factory: Name of the service that will create dflydev\markdown\IMarkdownParser instances, string.
  • markdown.parser: Name of the built-in parser to use, string. Default: markdown, (*6)

    Available options:, (*7)

    • markdown: Standard Markdown parser
    • extra: Markdown Extra parser

Services

  • markdown: Markdown parser, instance of dflydev\markdown\IMarkdownParser., (*8)

    If markdown.factory is defined, that service will be used to create the IMarkdownParser instance. Otherwise, markdown.parser will be examined and an instance of the appropriate class will be instantiated., (*9)

Tests

If you wish to run the tests you need to have PHPUnit installed. Then, from the silex-markdown root directory run:, (*10)

phpunit

(You may need to adapt the phpunit command and paths depending on your configuration.), (*11)

The Versions

05/08 2013

dev-master

9999999-dev http://github.com/nicl/silex-markdown

Simple Silex wrapper for the Dragonfly markdown library

  Sources   Download

MIT

The Requires

 

by Nicolas Long

markdown

05/08 2013

1.1.0

1.1.0.0 http://github.com/nicl/silex-markdown

Simple Silex wrapper for the Dragonfly markdown library

  Sources   Download

MIT

The Requires

 

by Nicolas Long

markdown

16/10 2012

1.0.0

1.0.0.0 http://github.com/nicl/silex-markdown

Simple Silex wrapper for the Dragonfly markdown library

  Sources   Download

The Requires

 

by Nicolas Long

markdown