Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.
/ silex-markdown Public archive
forked from nicl/Silex-Markdown

A lightweight markdown service provider for Silex

License

Notifications You must be signed in to change notification settings

bretrzaun/silex-markdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silex-Markdown

Build Status Scrutinizer Code Quality

A lightweight markdown service provider for Silex. Uses the michelf/php-markdown markdown parser.

Based on: nicl/silex-markdown

Installation

Recommended installation is through composer. Just add the following to your composer.json file:

{
    "require": {
        "bretrzaun/silex-markdown": "^1.0"
    }
}

Usage

To use the service provider first register it:

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

You can then use the markdown filter in Twig files. For example:

{{ '#Hello World'|markdown }}

In addition, you also have access to the Markdown parser itself. Simply instantiate it and call the transform method as follows:

$app['markdown']->transform($txt);

Configuration

Parameters

  • markdown.factory: Name of the service that will create Michelf\MarkdownInterface instances, string.

  • markdown.parser: Name of the built-in parser to use, string. Default: markdown

    Available options:

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

Services

  • markdown: Markdown parser, instance of Michelf\MarkdownInterface.

Tests

If you wish to run the tests then, from the silex-markdown root directory run:

composer test

About

A lightweight markdown service provider for Silex

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%