Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lzinga/blazortextdiff

A blazor component to display side by side text diff.
https://github.com/lzinga/blazortextdiff

blazor blazor-component component diff text-diff

Last synced: 5 days ago
JSON representation

A blazor component to display side by side text diff.

Awesome Lists containing this project

README

        

# Blazor Text Diff
A component to display side by side text diff using the [DiffPlex](https://github.com/mmanela/diffplex) library. There is probably some issues that I have looked over so if you notice one please submit an issue or do a pull request!

[![publish to nuget](https://github.com/lzinga/BlazorTextDiff/workflows/publish%20to%20nuget/badge.svg)![Nuget](https://img.shields.io/nuget/v/BlazorTextDiff)](https://www.nuget.org/packages/BlazorTextDiff)

![Static Diff](https://i.imgur.com/t0nJPeZ.png)
![Async Diff](https://i.imgur.com/lzjfjhF.png)

# Installation
You will need to add the nuget package DiffPlex into your project for this to work. An example project can be found in the [Samples Folder](https://github.com/lzinga/BlazorTextDiff/tree/master/samples/BlazorTextDiff.Web) for implementation.

```csharp
// Program.cs
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);

// These must be injected into your application to supply the component with its diff checking.
builder.Services.AddScoped();
builder.Services.AddScoped();

builder.RootComponents.Add("app");

await builder.Build().RunAsync();
}
```

```html

```

# Usage
```html

OldText="Old Text"


NewText="New Text"



CollapseContent="true"


ShowWhiteSpace="true"

>





```