diff --git a/README.md b/README.md index 7fbc052..3d8a796 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,25 @@ or via reference to [a later defined url][massivedynamic], i we so desire. [massivedynamic]: https://massivedynamic.eu +## Usage +Simply construct an new `parkdown\Parkdown` object and pass the Markdown source code to it's constructor. The parsed `DOMDocument` or it's `HTML` output can then be retrieved through the `::html()` and `::tree()` member functions. + +**Example** + +```php + use parkdown\Parkdown; + + $source = " + This is a **bold** word in a paragraph. + "; + + $parser = new Parkdown($source); + $tree = $parser->tree(); + + print_r($tree); + echo $parser->html(); +``` + ## Testing Unit tests can be run via `composer`: