https://github.com/jung-hunsoo/exdiff
Text difference library for Elixir
https://github.com/jung-hunsoo/exdiff
elixir hex
Last synced: 4 months ago
JSON representation
Text difference library for Elixir
- Host: GitHub
- URL: https://github.com/jung-hunsoo/exdiff
- Owner: jung-hunsoo
- License: mit
- Created: 2018-03-14T07:10:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T17:11:37.000Z (about 6 years ago)
- Last Synced: 2025-11-21T19:31:24.557Z (7 months ago)
- Topics: elixir, hex
- Language: Elixir
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Exdiff
[](https://hex.pm/packages/exdiff)
Text difference library for Elixir
## Installation
Add `exdiff` to your `mix.exs` dependencies:
```elixir
def deps do
[{:exdiff, "~> 0.1.5"}]
end
```
## Quick example
```elixir
> Exdiff.diff("abd", "abcd")
%{html: "
abcd", length: 1}
> Exdiff.diff("abd", "abcd", wrapper_tag: "span")
%{html: "abcd", length: 1}
> Exdiff.diff_to_html("abd", "abcd")
{1, "
abcd"}
> Exdiff.diff_to_html("abd", "abcd", wrapper_tag: "span")
{1, "abcd"}
```
## Usage
There are three HTML classes wrapped with tag.
- `exdiff-del`
- `exdiff-ins`
- `exdiff-eq`
## Test
`mix test`