symplify/markdown-diff

Package to print diffs for Markdown

Installs: 1 223 721

Dependents: 1

Suggesters: 0

Security: 0

Stars: 20

Watchers: 2

Forks: 0


README

Downloads total

Install

composer require symplify/markdown-diff

Add to config/bundles.php:

use Symplify\MarkdownDiff\Bundle\MarkdownDiffBundle;

return [
    MarkdownDiffBundle::class => [
        'all' => true,
    ],
];

Usage

namespace App;

use Symplify\MarkdownDiff\Differ\MarkdownDiffer;

final class SomeClass
{
    /**
     * @var MarkdownDiffer
     */
    private $markdownDiffer;

    public function __construct(MarkdownDiffer $markdownDiffer)
    {
        $this->markdownDiffer = $markdownDiffer;
    }

    public function run(): void
    {
        $markdownDiff = $this->markdownDiffer->diff('oldContent', 'newContent');
        // ...
    }
}

Report Issues

In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker

Contribute

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.