定制 nicl/silex-markdown 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nicl/silex-markdown

最新稳定版本:1.1.0

Composer 安装命令:

composer require nicl/silex-markdown

包简介

Simple Silex wrapper for the Dragonfly markdown library

关键字:

README 文档

README

A lightweight markdown service provider for Silex. Uses the Dragonfly markdown parser.

Installation

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

{
    "minimum-stability": "dev",
    "require": {
        "nicl/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 transformMarkdown method as follows:

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

    Available options:

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

Services

  • markdown: Markdown parser, instance of dflydev\markdown\IMarkdownParser.

    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.

Tests

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

phpunit

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

统计信息

  • 总下载量: 18.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固