diff --git a/composer.json b/composer.json index f5a65107..4df72391 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "symfony/process": "^2.3|^3.0", "symfony/filesystem": "^2.3|^3.0", "fzaninotto/faker": "^1.5", - "aydin-hassan/cli-md-renderer": "~1.0", + "aydin-hassan/cli-md-renderer": "^2.0", "php-school/psx": "~1.0", "php-school/cli-menu": "^1.0.3", "beberlei/assert": "^2.4", diff --git a/composer.lock b/composer.lock index 8698e2f9..fb3291da 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "29079feccc0cab9039a34d0884ddb498", - "content-hash": "c69c183c2932a5171a4097073615c9d5", + "hash": "175a827bff16df6442df853b0cfbf0cb", + "content-hash": "be74ee1640009c2f55fbaa5dd674d7a9", "packages": [ { "name": "aydin-hassan/cli-md-renderer", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/AydinHassan/cli-md-renderer.git", - "reference": "9b0ea965eab2033ce6df4c9094c35c1a3d52a602" + "reference": "5d02871053700154ef0e5cdecfacb3c63291abcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AydinHassan/cli-md-renderer/zipball/9b0ea965eab2033ce6df4c9094c35c1a3d52a602", - "reference": "9b0ea965eab2033ce6df4c9094c35c1a3d52a602", + "url": "https://api.github.com/repos/AydinHassan/cli-md-renderer/zipball/5d02871053700154ef0e5cdecfacb3c63291abcd", + "reference": "5d02871053700154ef0e5cdecfacb3c63291abcd", "shasum": "" }, "require": { - "league/commonmark": "^0.11.3", + "league/commonmark": "^0.13", "nikic/php-parser": "^2.0", "php": ">=5.5", "php-school/psx": "^1.1.1" @@ -48,20 +48,20 @@ } ], "description": "A CLI Markdown Render for league/commonmark compatibile AST", - "time": "2015-12-04 18:09:36" + "time": "2016-06-27 11:59:44" }, { "name": "beberlei/assert", - "version": "v2.5", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a" + "reference": "8a9ad22f1220e47a6d174843e8abef08f5eac441" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", + "url": "https://api.github.com/repos/beberlei/assert/zipball/8a9ad22f1220e47a6d174843e8abef08f5eac441", + "reference": "8a9ad22f1220e47a6d174843e8abef08f5eac441", "shasum": "" }, "require": { @@ -101,7 +101,7 @@ "assertion", "validation" ], - "time": "2016-03-22 14:34:51" + "time": "2016-06-20 12:01:28" }, { "name": "container-interop/container-interop", @@ -231,16 +231,16 @@ }, { "name": "league/commonmark", - "version": "0.11.3", + "version": "0.13.4", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d22d6a6a4b049faccc2f8e491cce6076eeb165c7" + "reference": "83f8210427fb01f671e272bb8d44b4ed3a94d459" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d22d6a6a4b049faccc2f8e491cce6076eeb165c7", - "reference": "d22d6a6a4b049faccc2f8e491cce6076eeb165c7", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/83f8210427fb01f671e272bb8d44b4ed3a94d459", + "reference": "83f8210427fb01f671e272bb8d44b4ed3a94d459", "shasum": "" }, "require": { @@ -251,14 +251,17 @@ "colinodell/commonmark-php": "*" }, "require-dev": { + "cebe/markdown": "~1.0", "erusev/parsedown": "~1.0", - "jgm/commonmark": "0.22", - "jgm/smartpunct": "0.22", + "jgm/commonmark": "0.25", "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "~1.1.0", - "phpunit/phpunit": "~4.3", - "phpunit/phpunit-mock-objects": "2.3.0", - "symfony/finder": "~2.3" + "mikehaertl/php-shellcommand": "~1.2.0", + "phpunit/phpunit": "~4.3|~5.0", + "scrutinizer/ocular": "~1.1", + "symfony/finder": "~2.3|~3.0" + }, + "suggest": { + "league/commonmark-extras": "Library of useful extensions including smart punctuation" }, "bin": [ "bin/commonmark" @@ -266,7 +269,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.12-dev" + "dev-master": "0.14-dev" } }, "autoload": { @@ -282,7 +285,7 @@ { "name": "Colin O'Dell", "email": "colinodell@gmail.com", - "homepage": "http://www.colinodell.com", + "homepage": "https://www.colinodell.com", "role": "Lead Developer" } ], @@ -293,7 +296,7 @@ "markdown", "parser" ], - "time": "2015-09-25 12:40:32" + "time": "2016-06-14 14:49:29" }, { "name": "myclabs/php-enum", @@ -392,16 +395,16 @@ }, { "name": "php-di/invoker", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/PHP-DI/Invoker.git", - "reference": "e67ce4ca7b2cebcd06929bf383e0b18441e8ea4d" + "reference": "4140c38ca17268adc500b1e5c85c4055e48608d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/e67ce4ca7b2cebcd06929bf383e0b18441e8ea4d", - "reference": "e67ce4ca7b2cebcd06929bf383e0b18441e8ea4d", + "url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/4140c38ca17268adc500b1e5c85c4055e48608d2", + "reference": "4140c38ca17268adc500b1e5c85c4055e48608d2", "shasum": "" }, "require": { @@ -431,7 +434,7 @@ "invoke", "invoker" ], - "time": "2016-05-29 13:31:47" + "time": "2016-06-12 09:09:55" }, { "name": "php-di/php-di", @@ -668,7 +671,7 @@ }, { "name": "symfony/filesystem", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -717,16 +720,16 @@ }, { "name": "symfony/process", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1574f3451b40fa9bbae518ef71d19a56f409cac0" + "reference": "6350e63ed9c232da50e00f00a7e0330f066387a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1574f3451b40fa9bbae518ef71d19a56f409cac0", - "reference": "1574f3451b40fa9bbae518ef71d19a56f409cac0", + "url": "https://api.github.com/repos/symfony/process/zipball/6350e63ed9c232da50e00f00a7e0330f066387a2", + "reference": "6350e63ed9c232da50e00f00a7e0330f066387a2", "shasum": "" }, "require": { @@ -762,7 +765,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-04-12 19:11:33" + "time": "2016-06-06 11:42:41" }, { "name": "zendframework/zend-diactoros", @@ -873,16 +876,16 @@ }, { "name": "composer/composer", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "b2cf67b1a575d7e648c742be2454339232ef32b2" + "reference": "30ab6f1c1753267d181839142fafe022313c3c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/b2cf67b1a575d7e648c742be2454339232ef32b2", - "reference": "b2cf67b1a575d7e648c742be2454339232ef32b2", + "url": "https://api.github.com/repos/composer/composer/zipball/30ab6f1c1753267d181839142fafe022313c3c9a", + "reference": "30ab6f1c1753267d181839142fafe022313c3c9a", "shasum": "" }, "require": { @@ -946,7 +949,7 @@ "dependency", "package" ], - "time": "2016-05-31 18:48:12" + "time": "2016-06-26 14:42:08" }, { "name": "composer/semver", @@ -1687,16 +1690,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.4.4", + "version": "5.4.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "02d5b64aa0837a038a5a4faeeefa5ef44bdcb928" + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/02d5b64aa0837a038a5a4faeeefa5ef44bdcb928", - "reference": "02d5b64aa0837a038a5a4faeeefa5ef44bdcb928", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", "shasum": "" }, "require": { @@ -1715,7 +1718,7 @@ "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", + "sebastian/environment": "^1.3 || ^2.0", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/object-enumerator": "~1.0", @@ -1761,20 +1764,20 @@ "testing", "xunit" ], - "time": "2016-06-09 09:09:27" + "time": "2016-06-16 06:01:15" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.2.1", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3" + "reference": "b13d0d9426ced06958bd32104653526a6c998a52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3", - "reference": "0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52", "shasum": "" }, "require": { @@ -1820,7 +1823,7 @@ "mock", "xunit" ], - "time": "2016-06-04 05:52:19" + "time": "2016-06-12 07:37:26" }, { "name": "psr/log", @@ -2073,16 +2076,16 @@ }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -2090,12 +2093,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2135,7 +2139,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -2590,16 +2594,16 @@ }, { "name": "symfony/console", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f62db5b8afec27073a4609b8c84b1f9936652259" + "reference": "64a4d43b045f07055bb197650159769604cb2a92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f62db5b8afec27073a4609b8c84b1f9936652259", - "reference": "f62db5b8afec27073a4609b8c84b1f9936652259", + "url": "https://api.github.com/repos/symfony/console/zipball/64a4d43b045f07055bb197650159769604cb2a92", + "reference": "64a4d43b045f07055bb197650159769604cb2a92", "shasum": "" }, "require": { @@ -2646,11 +2650,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-05-30 06:58:39" + "time": "2016-06-14 11:18:07" }, { "name": "symfony/finder", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2758,16 +2762,16 @@ }, { "name": "symfony/yaml", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "eca51b7b65eb9be6af88ad7cc91685f1556f5c9a" + "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eca51b7b65eb9be6af88ad7cc91685f1556f5c9a", - "reference": "eca51b7b65eb9be6af88ad7cc91685f1556f5c9a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c5a7e7fc273c758b92b85dcb9c46149ccda89623", + "reference": "c5a7e7fc273c758b92b85dcb9c46149ccda89623", "shasum": "" }, "require": { @@ -2803,7 +2807,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-05-26 21:46:24" + "time": "2016-06-14 11:18:07" }, { "name": "webmozart/assert", diff --git a/src/Factory/MarkdownCliRendererFactory.php b/src/Factory/MarkdownCliRendererFactory.php index d8659882..a160a30f 100644 --- a/src/Factory/MarkdownCliRendererFactory.php +++ b/src/Factory/MarkdownCliRendererFactory.php @@ -4,11 +4,11 @@ use Colors\Color; use Interop\Container\ContainerInterface; +use League\CommonMark\Block\Element\Heading; use PhpSchool\CliMenu\Terminal\TerminalInterface; use League\CommonMark\Block\Element\Document; use League\CommonMark\Block\Element\FencedCode; -use League\CommonMark\Block\Element\Header; -use League\CommonMark\Block\Element\HorizontalRule; +use League\CommonMark\Block\Element\ThematicBreak; use League\CommonMark\Block\Element\Paragraph; use League\CommonMark\Inline\Element\Code; use League\CommonMark\Inline\Element\Emphasis; @@ -50,20 +50,20 @@ public function __invoke(ContainerInterface $c) $codeRender->addSyntaxHighlighter('php', new PhpHighlighter($highlighterFactory->__invoke())); $blockRenderers = [ - Document::class => new DocumentRenderer, - Header::class => new HeaderRenderer, - HorizontalRule::class => new HorizontalRuleRenderer($terminal->getWidth()), - Paragraph::class => new ParagraphRenderer, - FencedCode::class => $codeRender, + Document::class => new DocumentRenderer, + Heading::class => new HeaderRenderer, + ThematicBreak::class => new HorizontalRuleRenderer($terminal->getWidth()), + Paragraph::class => new ParagraphRenderer, + FencedCode::class => $codeRender, ]; $inlineBlockRenderers = [ - Text::class => new TextRenderer, - Code::class => new CodeRenderer, - Emphasis::class => new EmphasisRenderer, - Strong::class => new StrongRenderer, - Newline::class => new NewlineRenderer, - Link::class => new LinkRenderer, + Text::class => new TextRenderer, + Code::class => new CodeRenderer, + Emphasis::class => new EmphasisRenderer, + Strong::class => new StrongRenderer, + Newline::class => new NewlineRenderer, + Link::class => new LinkRenderer, ]; return new CliRenderer(