symplify/markdown-diff

This package is abandoned and no longer maintained. The author suggests using the symplify/rule-doc-generator package instead.

Package to print diffs for Markdown

This package is auto-updated.

Last update: 2022-02-25 00:00:29 UTC


README

Downloads total

Install

composer require symplify/markdown-diff

Add to config/config.php:

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\MarkdownDiff\ValueObject\MarkdownDiffConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
    $containerConfigurator->import(MarkdownDiffConfig::class);
};

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.