cebe/markdown
About
cebe/markdown is a super fast, highly extensible markdown parser for PHP.
It is a set of PHP classes, each representing a Markdown flavor, and a command line tool for converting markdown files to HTML files.
The implementation focus is to be fast (see benchmark) and extensible. You are able to add additional language elements by directly hooking into the parser - no (possibly error-prone) post- or pre-processing is needed to extend the language. It is also well tested to provide best rendering results also in edge cases where other parsers fail.
Currently the following markdown flavors are supported:
- The original Markdown according to http://daringfireball.net/projects/markdown/syntax (try it!).
- Github flavored Markdown according to https://help.github.com/articles/github-flavored-markdown (try it!).
- Markdown Extra according to http://michelf.ca/projects/php-markdown/extra/ (currently not fully supported WIP see #25, try it!)
- Any mixed Markdown flavor you like because of its highly extensible structure (See the README).
Future plans are to support:
- Smarty Pants http://daringfireball.net/projects/smartypants/
- ... (Feel free to suggest further additions!)
Installation
PHP 5.4 or higher is required to use it. It will also run on facebook's hhvm.
Installation is recommended to be done via composer by adding the following to the require
section in your composer.json
:
"cebe/markdown": "*"
Run composer update
afterwards.
Alternatively you can clone the repository and use the classes directly.
In this case you have to include the Parser.php
and Markdown.php
files yourself.