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);
};
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');
// ...
}
}
In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker
The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.