pk/markdownify-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pk/markdownify-bundle

最新稳定版本:v4.1.0

Composer 安装命令:

composer require pk/markdownify-bundle

包简介

Symfony2 bundle that integrates the Markdownify class as a service

README 文档

README

When Symfony was in version 2 (and later 3) this bundle made a lot more sense than it does now. With the introduction of Symfony 4, bundles become less and less important. Furthermore, this bundle mainly adds a service, which you can easily configure in your Symfony application. You don't need a bundle for that.

For these reasons, the project is deprecated and will be archived in some time. If you are using this, please consider removing it and configure the service like this:

services:
  markdownify:
    class: Markdownify\ConverterExtra
    arguments: [] # optionally specify some arguments    

Original readme:

Provides Symfony integration for the Markdownify/Markdownify_Extra scripts.

The original Markdownify from Milian Wolff has been refactored by myself (see modifications) and later by Pixel418.

The latter is now merged back into this bundle as a dependency, so that the ongoing development in that repo is also available in this bundle.

Requirements

The bundle is built for Symfony 2.7 and up. It should work on older versions, but they are not supported.

Installation

php composer.phar require "pk/markdownify-bundle:^4.0"

AppKernel.php

Add to app/AppKernel.php:

new PK\MarkdownifyBundle\PKMarkdownifyBundle()

Configuration

The configuration is optional as all options have defaults.

pk_markdownify:
  # Where to put the link references:
  # * 0 for after the content (default)
  # * 1 for after each paragraph
  # * 2 for in the paragraph, directly after the link text
  link_position: 0

  # When larger than the minimal width (25), the body will be
  # wrapped to this width. Set to false to disable wrapping (default)
  body_width: false

  # Whether to keep html tags which cannot be converted to markdown
  keep_html: false

Usage

The bundle registers a markdownify service. Use it as you would use the Markdownify class:

$converter = $container->get('markdownify');
$converter->parseString('<h1>Heading</h1>');
// Returns: # Heading

NOTE: Before version 3.0, the Markdownify classes were included in this bundle, which had a different namespace than the \Markdownify one used currently. If you use this namespace somewhere in your code, be sure to update them when upgrading to 3.0.

Modifications

The following modifications have been applied to the original Markdownify code.

  • PSR 0 to 2 coding standards fix
  • Organised properties and methods (properties first, then methods)

License

The MIT License (MIT). Please see License File for more information.

Credits

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-15