MarkdownParser/README.md

47 lines
2.2 KiB
Markdown
Raw Normal View History

2013-11-16 08:51:01 +01:00
## Parsedown
2013-07-23 22:32:45 +02:00
2014-11-12 21:27:29 +01:00
Better Markdown Parser in PHP
2013-07-10 22:22:16 +02:00
2014-09-12 23:11:56 +02:00
[[ demo ]](http://parsedown.org/demo)
2013-11-23 14:58:58 +01:00
2013-12-03 21:49:50 +01:00
### Features
2013-11-23 14:58:58 +01:00
2014-04-17 10:22:49 +02:00
* [Fast](http://parsedown.org/speed)
* [Consistent](http://parsedown.org/consistency)
2014-11-12 02:36:17 +01:00
* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
2014-09-14 00:14:40 +02:00
* [Tested](http://parsedown.org/tests/) in PHP 5.2, 5.3, 5.4, 5.5, 5.6 and [hhvm](http://www.hhvm.com/)
2014-04-17 10:22:49 +02:00
* Extensible
2014-05-14 19:07:52 +02:00
* [Markdown Extra extension](https://github.com/erusev/parsedown-extra) <sup>new</sup>
2014-06-18 11:27:25 +02:00
* [JavaScript port](https://github.com/hkdobrev/parsedown.js) under development <sup>new</sup>
2013-07-23 09:36:28 +02:00
2013-07-23 22:32:45 +02:00
### Installation
2014-11-12 02:37:36 +01:00
Include `Parsedown.php` or install [the composer package](https://packagist.org/packages/erusev/parsedown).
2013-07-23 22:32:45 +02:00
### Example
2013-07-23 22:32:45 +02:00
2014-02-21 01:49:59 +01:00
``` php
2014-05-17 16:13:00 +02:00
$Parsedown = new Parsedown();
2013-07-23 22:32:45 +02:00
2014-05-17 16:13:00 +02:00
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
2013-11-13 00:38:29 +01:00
```
2014-05-16 00:15:21 +02:00
2014-09-12 22:52:06 +02:00
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/Usage) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
2014-05-17 16:13:00 +02:00
2014-05-16 00:15:21 +02:00
### Questions
2014-05-16 00:27:54 +02:00
**How does Parsedown work?**<br/>
2015-01-05 13:18:36 +01:00
Parsedown tries to read Markdown like a human. First, it looks at the lines. Its interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line start with a `-` then it perhaps belong to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
2014-05-16 00:15:21 +02:00
2014-05-16 00:27:54 +02:00
**Why doesnt Parsedown use namespaces?**<br/>
2014-09-12 23:11:56 +02:00
Using namespaces would mean dropping support for PHP 5.2. We believe that since Parsedown is a single class with an uncommon name, making this trade wouldn't be worth it.
2014-05-16 00:15:21 +02:00
2014-09-09 13:30:17 +02:00
**Is Parsedown compliant with CommonMark?**<br/>
We are [working on it](https://github.com/erusev/parsedown/tree/commonmark).
2014-05-16 00:27:54 +02:00
**Who uses Parsedown?**<br/>
2014-12-12 01:30:45 +01:00
[phpDocumentor](http://www.phpdoc.org/), [October CMS](http://octobercms.com/), [Bolt CMS](http://bolt.cm/), [Kirby CMS](http://getkirby.com/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://www.versioneye.com/php/erusev:parsedown/references).
2014-12-10 16:19:05 +01:00
**How can I help?**<br/>
2014-12-11 13:34:58 +01:00
Use the project, tell friends about it and if you feel generous, [donate some money](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2).