|
| 1 | +PHP Markdown & Extra |
| 2 | +==================== |
| 3 | + |
| 4 | +An updated and stripped version of the original [PHP Markdown](http://michelf.com/projects/php-markdown/) |
| 5 | +by [Michel Fortin](http://michelf.com/). Works quite well with PSR-0 |
| 6 | +autoloaders and is [Composer](http://packagist.org/) friendly. |
| 7 | + |
| 8 | + |
| 9 | +Changes from the official PHP Markdown & Extra |
| 10 | +---------------------------------------------- |
| 11 | + |
| 12 | +The initial pass at updating PHP Markdown & Extra left the core of |
| 13 | +the code more or less intact but the changes to the organization |
| 14 | +and naming were quite substantial. This effectively makes this package |
| 15 | +a hard fork from Markdown 1.0.1n and MarkdownExtra 1.2.4. |
| 16 | + |
| 17 | +Updated in the following ways: |
| 18 | + |
| 19 | + * Moved parser classes into their own files |
| 20 | + * Using PHP 5.3 namespaces |
| 21 | + * Following [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) standards |
| 22 | + * Replaced `@define` configuration variables with class `const` variables |
| 23 | + * Integrated with [Travis CI](http://travis-ci.org/) |
| 24 | + * Made [Composer](http://packagist.org/) friendly |
| 25 | + |
| 26 | +Stripped in the following ways: |
| 27 | + |
| 28 | + * No more embedded plugin code (WordPress, bBlog, etc.) |
| 29 | + * No more top level function calls (`Markdown()`, etc.) |
| 30 | + |
| 31 | + |
| 32 | +Requirements |
| 33 | +------------ |
| 34 | + |
| 35 | + * PHP 5.3+ |
| 36 | + |
| 37 | + |
| 38 | +Usage |
| 39 | +----- |
| 40 | + |
| 41 | +Simple usage for the standard Markdown ([details](http://michelf.com/projects/php-markdown/)) parser: |
| 42 | + |
| 43 | + <?php |
| 44 | + use dflydev\markdown\Markdown; |
| 45 | + |
| 46 | + $markdownParser = new MarkdownParser(); |
| 47 | + |
| 48 | + // Will return <h1>Hello World</h1> |
| 49 | + $markdownParser->transformMarkdown("#Hello World"); |
| 50 | + |
| 51 | +Simple usage for the Markdown Extra ([details](http://michelf.com/projects/php-markdown/extra/)) parser: |
| 52 | + |
| 53 | + <?php |
| 54 | + use dflydev\markdown\MarkdownExtra; |
| 55 | + |
| 56 | + $markdownParser = new MarkdownExtraParser(); |
| 57 | + |
| 58 | + // Will return <h1>Hello World</h1> |
| 59 | + $markdownParser->transformMarkdown("#Hello World"); |
| 60 | + |
| 61 | + |
| 62 | +License |
| 63 | +------- |
| 64 | + |
| 65 | +This library is licensed under the New BSD License - see the LICENSE file for details. |
| 66 | + |
| 67 | + |
| 68 | +Community |
| 69 | +--------- |
| 70 | + |
| 71 | +If you have questions or want to help out, join us in the |
| 72 | +[#dflydev](irc://irc.freenode.net/#dflydev) channel on irc.freenode.net. |
| 73 | + |
| 74 | + |
| 75 | +Not Invented Here |
| 76 | +----------------- |
| 77 | + |
| 78 | +The original [PHP Markdown](http://michelf.com/projects/php-markdown/) was |
| 79 | +quite excellent but was not as easy to use as it could be in more modern PHP |
| 80 | +applications. Having started to use [Composer](http://packagist.org/) for a |
| 81 | +few newer applications that needed to transform Markdown, I decided to strip |
| 82 | +and update the original PHP Markdown so that it could be more easily managed |
| 83 | +by the likes of Composer. |
| 84 | + |
| 85 | +All of the initial work done for this library (which I can only assume |
| 86 | +was quite substantial after having looked at the code) was done by |
| 87 | +[Michel Fortin](http://michelf.com/) during the original port from Perl to |
| 88 | +PHP. |
| 89 | + |
| 90 | +If you do not need to install PHP Markdown by way of Composer or need to |
| 91 | +leverage PSR-0 autoloading, I suggest you continue to use the official and |
| 92 | +likely more stable and well used original version of |
| 93 | +[PHP Markdown](http://michelf.com/projects/php-markdown/) |
0 commit comments