• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dflydev/dflydev-markdown: PHP Markdown & Extra — DEPRECATED

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

dflydev/dflydev-markdown

开源软件地址(OpenSource Url):

https://github.com/dflydev/dflydev-markdown

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

PHP Markdown & Extra

An updated and stripped version of the original PHP Markdown by Michel Fortin. Works quite well with PSR-0 autoloaders and is Composer friendly.

This Project Has Been Deprecated

Thank you for your interest in contributing to this package. Unfortunately, I do not plan to continue maintaining this package.

The original purpose of this package was to provide a way to get a PSR-0 and Composer friendly port of Michel Fortin's PHP Markdown library on Packagist. Michel was originally uninterested in Composer and did not want to make changes and said I was free to fork and maintain a special Composer package.

In January of 2013 (or around then) Michel finally joined the Composer bandwagon. More details can be found here. This means that the major reason this port existed (to be a Composer friendly port) effectively went away. This corresponded with the 1.3 release of PHP Markdown.

Additionally, other versions of PHP Markdown parsers have come into existence and are quite nice.

Please feel free to continue to use it as-is but if you are starting a new project I would recommend finding another library. If you have a project already depending on this package, I would recommend planning to migrate to something that is better maintained.

Thanks for your support and using this library over the years.


Changes from the official PHP Markdown & Extra

The initial pass at updating PHP Markdown & Extra left the core of the code more or less intact but the changes to the organization and naming were quite substantial. This effectively makes this package a hard fork from Markdown 1.0.1n and MarkdownExtra 1.2.4.

Updated in the following ways:

  • Moved parser classes into their own files
  • Using PHP 5.3 namespaces
  • Following PSR-0 standards
  • Replaced @define configuration variables with class const variables
  • Integrated with Travis CI
  • Made Composer friendly

Stripped in the following ways:

  • No more embedded plugin code (WordPress, bBlog, etc.)
  • No more top level function calls (Markdown(), etc.)

Last synced with:

  • PHP Markdown v1.0.1o
  • PHP Markdown Extra v1.2.5

Requirements

  • PHP 5.3+

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on dflydev/markdown to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on version 1.0 of this package:

{
    "require": {
        "dflydev/markdown": "1.0.*"
    }
}

Usage

Simple usage for the standard Markdown (details) parser:

<?php
use dflydev\markdown\MarkdownParser;

$markdownParser = new MarkdownParser();

// Will return <h1>Hello World</h1>
$markdownParser->transformMarkdown("#Hello World");

Simple usage for the Markdown Extra (details) parser:

<?php
use dflydev\markdown\MarkdownExtraParser;

$markdownParser = new MarkdownExtraParser();

// Will return <h1>Hello World</h1>
$markdownParser->transformMarkdown("#Hello World");

License

This library is licensed under the New BSD License - see the LICENSE file for details.

Community

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.

Not Invented Here

The original PHP Markdown was quite excellent but was not as easy to use as it could be in more modern PHP applications. Having started to use Composer for a few newer applications that needed to transform Markdown, I decided to strip and update the original PHP Markdown so that it could be more easily managed by the likes of Composer.

All of the initial work done for this library (which I can only assume was quite substantial after having looked at the code) was done by Michel Fortin during the original port from Perl to PHP.

If you do not need to install PHP Markdown by way of Composer or need to leverage PSR-0 autoloading, I suggest you continue to use the official and likely more stable and well used original version of PHP Markdown




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap